-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] $(document).ready() on development env #1715
Comments
Looks like you're using alpha 1. This might have been resolved in alpha 2 or in the master branch. Feel free to post here if it's still a problem in the newer releases, and we can revisit this issue. |
Hi, I've adapted code from alpha 3 which is:
And bug still remains. |
Okay, I'll look into it. In the meantime, you can use |
One more detail regarding this issue. The function which has inconsistent behaviour looks as follow:
So I basically returns the |
closed by #1751 |
Hi.
When hot reloading is enabled
ready
event is triggered before CSS styles are applied. I run into this issue when I've tried to determine active media query based on current CSS style. It works in production/release but doesn't work with webpack.The only workaround which I manage to came up with is defining
'process.env'
variable in thewebpack.config.js
file and based on its value switching$(document).ready()
to$(window).load()
.Here is the code:
assets/build/webpack.config.js
assets/scripts/main.js
Please tell me if there is any cleaner solution.
As a side note: I think that some kind of
process.env
variable might be useful in other cases too. Maybe it is a good idea to provide it by default?The text was updated successfully, but these errors were encountered: