mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
sortable: options.item can now be a function that returns a jQuery collection
This commit is contained in:
parent
dea9af8b4e
commit
aba9f32531
@ -159,7 +159,7 @@
|
|||||||
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--){
|
||||||
@ -167,7 +167,7 @@
|
|||||||
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user