Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sortable: options.item can now be a function that returns a jQuery co…
…llection
  • Loading branch information
Paul Bakaus committed May 29, 2008
1 parent dea9af8 commit aba9f32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/source/ui.sortable.js
Expand Up @@ -159,15 +159,15 @@
this.items = []; this.items = [];
this.containers = [this]; this.containers = [this];
var items = this.items; 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) { if(this.options.connectWith) {
for (var i = this.options.connectWith.length - 1; i >= 0; i--){ for (var i = this.options.connectWith.length - 1; i >= 0; i--){
var cur = $(this.options.connectWith[i]); var cur = $(this.options.connectWith[i]);
for (var j = cur.length - 1; j >= 0; j--){ for (var j = cur.length - 1; j >= 0; j--){
var inst = $.data(cur[j], 'sortable'); var inst = $.data(cur[j], 'sortable');
if(inst && !inst.options.disabled) { 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); this.containers.push(inst);
} }
}; };
Expand Down

0 comments on commit aba9f32

Please sign in to comment.