diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-16 14:51:56 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2009-01-16 14:51:56 +0000 |
commit | be932c2e58f9c47daa658ecf5775142b1c1a3d21 (patch) | |
tree | 12ed3eb9ab45b9ddcc8e0aa128a19f59c7b3d6ef /ui | |
parent | 79647cdf120464456008b8e29ed3c54e5f0685e8 (diff) | |
download | jquery-ui-be932c2e58f9c47daa658ecf5775142b1c1a3d21.tar.gz jquery-ui-be932c2e58f9c47daa658ecf5775142b1c1a3d21.zip |
droppable: removed all instances of $.ui.plugin, fairly safe here (fixes #3723)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.droppable.js | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/ui/ui.droppable.js b/ui/ui.droppable.js index 1d2f27e75..623467411 100644 --- a/ui/ui.droppable.js +++ b/ui/ui.droppable.js @@ -60,19 +60,15 @@ $.widget("ui.droppable", { }, _activate: function(event) { - var draggable = $.ui.ddmanager.current; - $.ui.plugin.call(this, 'activate', [event, this.ui(draggable)]); + if(this.options.activeClass) this.element.addClass(ui.options.activeClass); (draggable && this._trigger('activate', event, this.ui(draggable))); - }, _deactivate: function(event) { - var draggable = $.ui.ddmanager.current; - $.ui.plugin.call(this, 'deactivate', [event, this.ui(draggable)]); + if(this.options.activeClass) this.element.removeClass(ui.options.activeClass); (draggable && this._trigger('deactivate', event, this.ui(draggable))); - }, _over: function(event) { @@ -81,7 +77,7 @@ $.widget("ui.droppable", { if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { - $.ui.plugin.call(this, 'over', [event, this.ui(draggable)]); + if(this.options.hoverClass) this.element.addClass(ui.options.hoverClass); this._trigger('over', event, this.ui(draggable)); } @@ -93,7 +89,7 @@ $.widget("ui.droppable", { if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { - $.ui.plugin.call(this, 'out', [event, this.ui(draggable)]); + if(this.options.hoverClass) this.element.removeClass(ui.options.hoverClass); this._trigger('out', event, this.ui(draggable)); } @@ -114,7 +110,8 @@ $.widget("ui.droppable", { if(childrenIntersection) return false; if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { - $.ui.plugin.call(this, 'drop', [event, this.ui(draggable)]); + if(this.options.activeClass) this.element.removeClass(ui.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(ui.options.hoverClass); this._trigger('drop', event, this.ui(draggable)); return this.element; } @@ -285,32 +282,4 @@ $.ui.ddmanager = { } }; -/* - * Droppable Extensions - */ - -$.ui.plugin.add("droppable", "activeClass", { - activate: function(event, ui) { - $(this).addClass(ui.options.activeClass); - }, - deactivate: function(event, ui) { - $(this).removeClass(ui.options.activeClass); - }, - drop: function(event, ui) { - $(this).removeClass(ui.options.activeClass); - } -}); - -$.ui.plugin.add("droppable", "hoverClass", { - over: function(event, ui) { - $(this).addClass(ui.options.hoverClass); - }, - out: function(event, ui) { - $(this).removeClass(ui.options.hoverClass); - }, - drop: function(event, ui) { - $(this).removeClass(ui.options.hoverClass); - } -}); - })(jQuery); |