Antti Kaihola avatar Antti Kaihola committed 8372601 Draft

Moved bindSelectables() inside the closure to make sure it uses the correct jQuery. Fixes #72.

Comments (0)

Files changed (2)

+# HG changeset patch
+# Parent b7217d6a88f7846d0bfcb391d52b92116e1c5b3d
+
+diff -r b7217d6a88f7 selectable/static/selectable/js/jquery.dj.selectable.js
+--- a/selectable/static/selectable/js/jquery.dj.selectable.js	Thu Sep 20 20:57:57 2012 -0400
++++ b/selectable/static/selectable/js/jquery.dj.selectable.js	Tue Sep 25 11:16:35 2012 +0300
+@@ -255,9 +255,8 @@
+             }
+         }
+ 	});
+-})(jQuery);
+ 
+-function bindSelectables(context) {
++window.bindSelectables = function(context) {
+     /* Bind all selectable widgets in a given context.
+     Automatically called on document.ready.
+     Additional calls can be made for dynamically added widgets.
+@@ -278,7 +277,7 @@
+             }
+         );
+     });
+-}
++};
+ 
+ /* Monkey-patch Django's dynamic formset, if defined */
+ if (typeof(django) !== "undefined" && typeof(django.jQuery) !== "undefined") {
+@@ -335,6 +334,8 @@
+     };
+ }
+ 
++})(jQuery);
++
+ $(document).ready(function() {
+     // Bind existing widgets on document ready
+     if (typeof(djselectableAutoLoad) === "undefined" || djselectableAutoLoad) {
+issue-72
 # Placed by Bitbucket
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.