diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-19 15:08:02 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-19 15:08:02 +0000 |
commit | c3df1b6df6527cee743783cdb90d5a0fa4273b91 (patch) | |
tree | 97a83afabfd4bc73c2095921773046fdf173b0bf /ui | |
parent | fbde8766ba2dc3b70df1d4b95eefe316556bdae5 (diff) | |
download | jquery-ui-c3df1b6df6527cee743783cdb90d5a0fa4273b91.tar.gz jquery-ui-c3df1b6df6527cee743783cdb90d5a0fa4273b91.zip |
sortable: removing ui.options caused plugins not to work anymore - fixed all regressions
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.sortable.js | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 438ebe159..4ce0f691b 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -857,41 +857,43 @@ $.extend($.ui.sortable, { $.ui.plugin.add("sortable", "cursor", { start: function(event, ui) { - var t = $('body'); - if (t.css("cursor")) ui.options._cursor = t.css("cursor"); - t.css("cursor", ui.options.cursor); + var t = $('body'), i = $(this).data('sortable'); + if (t.css("cursor")) i.options._cursor = t.css("cursor"); + t.css("cursor", i.options.cursor); }, beforeStop: function(event, ui) { - if (ui.options._cursor) $('body').css("cursor", ui.options._cursor); + var i = $(this).data('sortable'); + if (i.options._cursor) $('body').css("cursor", i.options._cursor); } }); $.ui.plugin.add("sortable", "zIndex", { start: function(event, ui) { - var t = ui.helper; - if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex"); - t.css('zIndex', ui.options.zIndex); + var t = ui.helper, i = $(this).data('sortable'); + if(t.css("zIndex")) i.options._zIndex = t.css("zIndex"); + t.css('zIndex', i.options.zIndex); }, beforeStop: function(event, ui) { - if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex); + var i = $(this).data('sortable'); + if(i.options._zIndex) $(ui.helper).css('zIndex', i.options._zIndex); } }); $.ui.plugin.add("sortable", "opacity", { start: function(event, ui) { - var t = ui.helper; - if(t.css("opacity")) ui.options._opacity = t.css("opacity"); - t.css('opacity', ui.options.opacity); + var t = ui.helper, i = $(this).data('sortable'); + if(t.css("opacity")) i.options._opacity = t.css("opacity"); + t.css('opacity', i.options.opacity); }, beforeStop: function(event, ui) { - if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity); + var i = $(this).data('sortable'); + if(i.options._opacity) $(ui.helper).css('opacity', i.options._opacity); } }); $.ui.plugin.add("sortable", "scroll", { start: function(event, ui) { - var o = ui.options; - var i = $(this).data("sortable"); + var i = $(this).data('sortable'), o = i.options; i.overflowY = function(el) { do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); @@ -908,8 +910,7 @@ $.ui.plugin.add("sortable", "scroll", { }, sort: function(event, ui) { - var o = ui.options; - var i = $(this).data("sortable"); + var i = $(this).data('sortable'), o = i.options; if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') { if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - event.pageY < o.scrollSensitivity) @@ -940,11 +941,9 @@ $.ui.plugin.add("sortable", "scroll", { $.ui.plugin.add("sortable", "axis", { sort: function(event, ui) { - - var i = $(this).data("sortable"); - if(ui.options.axis == "y") i.position.left = i.originalPosition.left; - if(ui.options.axis == "x") i.position.top = i.originalPosition.top; - + var i = $(this).data('sortable'), o = i.options; + if(o.axis == "y") i.position.left = i.originalPosition.left; + if(o.axis == "x") i.position.top = i.originalPosition.top; } }); |