diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-01-31 16:54:06 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-01-31 16:54:06 +0000 |
commit | 34a5af87791686a1dd64c988361c69b97359196b (patch) | |
tree | 4114cc02ef00cadab8dc8da412c8fdd72080c3cb /ui | |
parent | bae4a16d61e6c19e4d30b7a7511ae1858a639d44 (diff) | |
download | jquery-ui-34a5af87791686a1dd64c988361c69b97359196b.tar.gz jquery-ui-34a5af87791686a1dd64c988361c69b97359196b.zip |
Sortable: Fixed #3979: Fixed using a string for connectWith option.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.sortable.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 7a71794f3..7330adb1d 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -462,14 +462,21 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { this.refreshPositions(); }, + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + _getItemsAsjQuery: function(connected) { var self = this; var items = []; var queries = []; + var connectWith = this._connectWith(); - if(this.options.connectWith && connected) { - var connectWith = this.options.connectWith.constructor == String ? [this.options.connectWith] : this.options.connectWith; + if(connectWith && connected) { for (var i = connectWith.length - 1; i >= 0; i--){ var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ @@ -515,10 +522,11 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { var items = this.items; var self = this; var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); - if(this.options.connectWith) { - for (var i = this.options.connectWith.length - 1; i >= 0; i--){ - var cur = $(this.options.connectWith[i]); + if(connectWith) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ var inst = $.data(cur[j], 'sortable'); if(inst && inst != this && !inst.options.disabled) { |