Issue with $ not being declared as global #25

Closed
kfwerf opened this Issue May 12, 2014 · 3 comments

Projects

None yet

3 participants

@kfwerf
kfwerf commented May 12, 2014

Hi,

I used your plugin and found out that the plugin assumes that jQuery is set to $. This gave issues with my current config as jQuery is not bound to $.

I would suggest that the plugin uses the jQuery keyword instead of the $ as that is more common, with noconflict configs.

So window.jQuery instead of window.$. What do you think? Good suggestion / issue?

(function (factory) {
  if (typeof define === 'function' && define.amd) {
    define(['jquery', 'modernizr'], factory);
  } else {
    factory(window.jQuery, window.Modernizr);
  }
})(function($, Modernizr, undefined) {

Otherwise thanks for this, isotope runs slow and this seems to better take advantage of the css3 transforms and such.

Cheers!

Kenneth

@Vestride
Owner

I had originally been using window.$ so that Zepto would work, but there are still a couple things which Shuffle uses that Zepto doesn't have. I will change it to use window.jQuery because the AMD block also specifies jQuery and not Zepto. 🍻

@steviehype

I wish I saw this 6 hours ago! Thanks :)

@Vestride
Owner
Vestride commented Jun 1, 2014

I cherry-picked the commit from the refactoring branch and pushed a new tag for 2.1.2.

@Vestride Vestride closed this Jun 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment