You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The modal is loaded before jQuery when jQuery is placed in the footer (with roots theme framework by example). Issue is easily fixed by wrapping the content of load_footer_script() (line ~77 to line ~183 in frontend/class-frontend.php) with a pure JavaScript "ready function" (document.addEventListener('DOMContentLoaded', function(){ /* CONTENT */ }); I can issue a pull request if you want or you can implement a "cleaner" version if you prefer.
Thank you,
BT
The text was updated successfully, but these errors were encountered:
Sorry I was not clear in the first message. The problem come from the fact that the ready function need jquery and jquery is loaded after. In the footer the order is:
your modal
your modal javascript (the one that use the ready function)
jquery
modernizr, bootstrap, etc
I assume you hook to the start of the footer (when the option is selected in the option panel) and add your code. I fixed it by replacing the jQuery ready function with a plain and pure JavaScript "ready" function. I will send you a pull request Monday when I'm at work or this weekend if I ever get time to set up a wamp stack and a fresh WordPress (just re installed windows). It's gonna be easier to see what I'm talking about.
Honestly I don't think it affects a lot of people. We used Roots starter theme to create our own and I think it messes up with your plugin when all scripts are loaded in the footer.
Beside that, nice plugin, even if I don't like sites that use popup like that haha. I'm not the one choosing what we do, so for what it does, it does it well.
Hi,
The modal is loaded before jQuery when jQuery is placed in the footer (with roots theme framework by example). Issue is easily fixed by wrapping the content of load_footer_script() (line ~77 to line ~183 in frontend/class-frontend.php) with a pure JavaScript "ready function" (document.addEventListener('DOMContentLoaded', function(){ /* CONTENT */ }); I can issue a pull request if you want or you can implement a "cleaner" version if you prefer.
Thank you,
BT
The text was updated successfully, but these errors were encountered: