]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: fixed toArray method
authorPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 14 Oct 2008 10:00:52 +0000 (10:00 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 14 Oct 2008 10:00:52 +0000 (10:00 +0000)
coverflow: renamed init to _init

ui/ui.sortable.js

index fdee32752e89720839275a7023ec8b364d7d4c63..6c81c2e940636ef6785077297ff419c969fca33a 100644 (file)
@@ -69,7 +69,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
                var str = []; o = o || {};
                
                $(items).each(function() {
-                       var res = ($(this.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
+                       var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
                        if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
                });
                
@@ -80,9 +80,9 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
        toArray: function(o) {
                
                var items = this._getItemsAsjQuery(o && o.connected);
-               var ret = [];
+               var ret = []; o = o || {};
                
-               items.each(function() { ret.push($(this).attr(o.attr || 'id')); });
+               items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
                return ret;
                
        },