Skip to main content

Bug Tracker

Side navigation

Ticket #2729: itemQuery.patch


File itemQuery.patch, 1.9 KB (added by rfb, April 21, 2008 09:03PM UTC)

patch to svn current

Index: ui/ui.sortable.js
===================================================================
--- ui/ui.sortable.js	(revision 5268)
+++ ui/ui.sortable.js	(working copy)
@@ -220,7 +220,10 @@
 			this.items = [];
 			this.containers = [this];
 			var items = this.items;
-			var queries = [$(this.options.items, this.element)];
+
+      // itemQuery allows us to refine the selection of items used in the sortable.
+      var queries = typeof this.options.itemQuery == 'function' ? 
+        this.options.itemQuery.apply(this) : [$(this.options.items, this.element)];
 			
 			if(this.options.connectWith) {
 				for (var i = this.options.connectWith.length - 1; i >= 0; i--){
Index: ui/demos/ui.sortable.html
===================================================================
--- ui/demos/ui.sortable.html	(revision 5268)
+++ ui/demos/ui.sortable.html	(working copy)
@@ -91,6 +91,27 @@
 	
 
+

5. Nested lists limited to 1 level deep

+
+
    +
  • Drag us
  • +
  • around
  • +
  • and change +
      +
    • Lorem
    • +
    • Ipsum
    • +
    +
  • +
  • our
  • +
  • positions +
      +
    • Something else
    • +
    • Foo bar
    • +
    +
  • +
+
+

Download in other formats:

Original Format