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
alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.');
The call to alert() stops rendering the page and depending on the website can appear multiple times. Instead of showing this error it should log to console with console.error(). That way visitors of a website aren't hindered by misconfiguration.
Edit: I have an existing website built with WordPress and Elementor Pro which seemingly uses this plugin (1.2.1 now, but before 1.1.x). There are no elements with the data-sm-options attribute yet the alert pops-up. It didn't do that with the 1.1.x version of SmartMenus.
The text was updated successfully, but these errors were encountered:
Ah, my issue was that I wasn't setting the data-sm-options-attribute properly. I guess since version 1.2.x it has become more critical of correctness? Still, would be a better user experience to log to console.
Works $('.elementor-nav-menu--main > ul').attr('data-sm-options', '{ "showTimeout": "0", "hideTimeout": "0" }');
Thanks for the fix. The release is 2 years old so I'm guessing this only came up recently because something has changed in browsers definition of a valid JSON not from this package. But yes it would be nice if it was console.error() rather than alert()
You should try forking the repo fixing it and making a pull request.
There are two
alert()
calls in the source code of SmartMenus:smartmenus/src/jquery.smartmenus.js
Line 1163 in 6b26165
smartmenus/src/jquery.smartmenus.js
Line 1025 in 6b26165
The call to
alert()
stops rendering the page and depending on the website can appear multiple times. Instead of showing this error it should log to console withconsole.error()
. That way visitors of a website aren't hindered by misconfiguration.Edit: I have an existing website built with WordPress and Elementor Pro which seemingly uses this plugin (1.2.1 now, but before 1.1.x). There are no elements with the
data-sm-options
attribute yet the alert pops-up. It didn't do that with the 1.1.x version of SmartMenus.The text was updated successfully, but these errors were encountered: