]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: options.item can now be a function that returns a jQuery collection
authorPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 29 May 2008 12:12:12 +0000 (12:12 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 29 May 2008 12:12:12 +0000 (12:12 +0000)
ui/source/ui.sortable.js

index cfa2cadb38d1072ebe51924fd6b90282f7598679..c0b15632e2183d76c9625836ebc49d5c60da8ecd 100644 (file)
                        this.items = [];\r
                        this.containers = [this];\r
                        var items = this.items;\r
-                       var queries = [$(this.options.items, this.element)];\r
+                       var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)];\r
                        \r
                        if(this.options.connectWith) {\r
                                for (var i = this.options.connectWith.length - 1; i >= 0; i--){\r
                                        for (var j = cur.length - 1; j >= 0; j--){\r
                                                var inst = $.data(cur[j], 'sortable');\r
                                                if(inst && !inst.options.disabled) {\r
-                                                       queries.push($(inst.options.items, inst.element));\r
+                                                       queries.push($.isFunction(inst.options.items) ? inst.options.items.call(this.element) : $(inst.options.items, inst.element));\r
                                                        this.containers.push(inst);\r
                                                }\r
                                        };\r