Skip to content
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

Possible portability issue #71

Open
asiby opened this issue Nov 16, 2017 · 0 comments
Open

Possible portability issue #71

asiby opened this issue Nov 16, 2017 · 0 comments

Comments

@asiby
Copy link

asiby commented Nov 16, 2017

Hello there

I have noticed something that rubs me the wrong way in jquery.meanmenu.js

The code in that file is wrapped in a IIFE like so ...

(function ($) {
  // Bunch of code
})(jQuery);

However, inside the code of the plugin, there is not a single place where the $ variable is being used when performing jQuery searches.

For instance, when initializing the defaults, it is done like this ...

var defaults = {
    meanMenuTarget: jQuery(this),
    // etc.
};

Instead, a better way of doing this would be ...

var defaults = {
  meanMenuTarget: $(this),
  // etc.
};

I believe that using the $ will avoid issues when more than one version of jQuery are being used in the same page ... in which case, $ will refer to the actual jQuery being used to initialize meanmenu instead of the global/default jQuery, which might not be compatible with meanmenu.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant