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

AMD version fails if jQuery is not defined as a global #493

Open
glenpike opened this issue Mar 2, 2015 · 0 comments
Open

AMD version fails if jQuery is not defined as a global #493

glenpike opened this issue Mar 2, 2015 · 0 comments

Comments

@glenpike
Copy link

glenpike commented Mar 2, 2015

register_widget function uses "jQuery" variable rather than the "$" which is local to the factory function.

Can be fixed with:

git diff src/jquery.gridster.js
diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js
index 7bac911..8a78907 100755
--- a/src/jquery.gridster.js
+++ b/src/jquery.gridster.js
@@ -839,7 +839,7 @@
     *  than the original.
     */
     fn.register_widget = function($el) {
-        var isDOM = $el instanceof jQuery;
+        var isDOM = $el instanceof $;
         var wgd = isDOM ? this.dom_to_coords($el) : $el;
         var posChanged = false;
         isDOM || ($el = wgd.el);
glenpike pushed a commit to glenpike/gridster.js that referenced this issue Mar 3, 2015
Run npm install and visit test/jquery.gridster-amd.html in browser.
dsmorse pushed a commit to dsmorse/gridster.js that referenced this issue Apr 8, 2015
* ducksboard/bug-493-jquery-no-global-fail:
  Fix for bug ducksboard#493 including unit tests to prove.
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