diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-29 12:12:12 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-29 12:12:12 +0000 |
commit | aba9f3253192bb4763650f16e9d2ed66092d6aac (patch) | |
tree | e42012931363638bd9e867b63dbb7d5ef2b30b5d /ui/source | |
parent | dea9af8b4e536729d2b179ad1fc9b808179fcbaa (diff) | |
download | jquery-ui-aba9f3253192bb4763650f16e9d2ed66092d6aac.tar.gz jquery-ui-aba9f3253192bb4763650f16e9d2ed66092d6aac.zip |
sortable: options.item can now be a function that returns a jQuery collection
Diffstat (limited to 'ui/source')
-rw-r--r-- | ui/source/ui.sortable.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/source/ui.sortable.js b/ui/source/ui.sortable.js index cfa2cadb3..c0b15632e 100644 --- a/ui/source/ui.sortable.js +++ b/ui/source/ui.sortable.js @@ -159,7 +159,7 @@ this.items = [];
this.containers = [this];
var items = this.items;
- var queries = [$(this.options.items, this.element)];
+ var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)];
if(this.options.connectWith) {
for (var i = this.options.connectWith.length - 1; i >= 0; i--){
@@ -167,7 +167,7 @@ for (var j = cur.length - 1; j >= 0; j--){
var inst = $.data(cur[j], 'sortable');
if(inst && !inst.options.disabled) {
- queries.push($(inst.options.items, inst.element));
+ queries.push($.isFunction(inst.options.items) ? inst.options.items.call(this.element) : $(inst.options.items, inst.element));
this.containers.push(inst);
}
};
|