diff options
author | Eduardo Lundgren <eduardolundgren@gmail.com> | 2009-01-16 02:09:45 +0000 |
---|---|---|
committer | Eduardo Lundgren <eduardolundgren@gmail.com> | 2009-01-16 02:09:45 +0000 |
commit | 8139c81d1b3521c8b8406a3c069c1c8829b05abe (patch) | |
tree | 1b1a3d259e4521916f7ec4d510ff5201f43d5ea7 /ui/ui.sortable.js | |
parent | 78c4d87d7b2f9f8ece53f062eb44cabf9dd51bf3 (diff) | |
download | jquery-ui-8139c81d1b3521c8b8406a3c069c1c8829b05abe.tar.gz jquery-ui-8139c81d1b3521c8b8406a3c069c1c8829b05abe.zip |
Revert changes for #3838 for the release 1.6rc5
Diffstat (limited to 'ui/ui.sortable.js')
-rw-r--r-- | ui/ui.sortable.js | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index dd4014e14..49387a442 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -12,14 +12,8 @@ */ (function($) { -var widgetName = "sortable"; -var classWidgetName = ".sortable"; - $.widget("ui.sortable", $.extend({}, $.ui.mouse, { _init: function() { - // update widgetName with the name given by the widget factory - widgetName = this.widgetName; - classWidgetName = '.' + widgetName; var o = this.options; this.containerCache = {}; @@ -42,8 +36,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { destroy: function() { this.element .removeClass(this.options.cssNamespace+"-sortable "+this.options.cssNamespace+"-sortable-disabled") - .removeData(widgetName) - .unbind(classWidgetName); + .removeData("sortable") + .unbind(".sortable"); this._mouseDestroy(); for ( var i = this.items.length - 1; i >= 0; i-- ) @@ -427,7 +421,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { for (var i = this.options.connectWith.length - 1; i >= 0; i--){ var cur = $(this.options.connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], widgetName); + var inst = $.data(cur[j], 'sortable'); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not("."+inst.options.cssNamespace+"-sortable-helper"), inst]); } @@ -474,7 +468,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { for (var i = this.options.connectWith.length - 1; i >= 0; i--){ var cur = $(this.options.connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], widgetName); + var inst = $.data(cur[j], 'sortable'); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); this.containers.push(inst); @@ -949,38 +943,38 @@ $.extend($.ui.sortable, { * Sortable Extensions */ -$.ui.plugin.add(widgetName, "cursor", { +$.ui.plugin.add("sortable", "cursor", { start: function(event, ui) { - var t = $('body'), i = $(this).data(widgetName); + 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) { - var i = $(this).data(widgetName); + var i = $(this).data('sortable'); if (i.options._cursor) $('body').css("cursor", i.options._cursor); } }); -$.ui.plugin.add(widgetName, "opacity", { +$.ui.plugin.add("sortable", "opacity", { start: function(event, ui) { - var t = ui.helper, i = $(this).data(widgetName); + 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) { - var i = $(this).data(widgetName); + var i = $(this).data('sortable'); if(i.options._opacity) $(ui.helper).css('opacity', i.options._opacity); } }); -$.ui.plugin.add(widgetName, "scroll", { +$.ui.plugin.add("sortable", "scroll", { start: function(event, ui) { - var i = $(this).data(widgetName), o = i.options; + var i = $(this).data("sortable"), o = i.options; if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); }, sort: function(event, ui) { - var i = $(this).data(widgetName), o = i.options, scrolled = false; + var i = $(this).data("sortable"), o = i.options, scrolled = false; if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { @@ -1014,14 +1008,14 @@ $.ui.plugin.add(widgetName, "scroll", { } }); -$.ui.plugin.add(widgetName, "zIndex", { +$.ui.plugin.add("sortable", "zIndex", { start: function(event, ui) { - var t = ui.helper, i = $(this).data(widgetName); + 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) { - var i = $(this).data(widgetName); + var i = $(this).data('sortable'); if(i.options._zIndex) $(ui.helper).css('zIndex', i.options._zIndex == 'auto' ? '' : i.options._zIndex); } }); |