diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:30:05 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:30:05 -0500 |
commit | 861842d361d053aed02895a57becaa28a95696eb (patch) | |
tree | cbe795027500cf57a373872f050d67760c14f563 /ui | |
parent | d2d301f074f814871a68e4c386bf619908f188c0 (diff) | |
download | jquery-ui-861842d361d053aed02895a57becaa28a95696eb.tar.gz jquery-ui-861842d361d053aed02895a57becaa28a95696eb.zip |
Draggable: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.draggable.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 92dd13c0d..ccc1fe81b 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -212,10 +212,10 @@ $.widget("ui.draggable", $.ui.mouse, { return false; if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { - var self = this; + var that = this; $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { - if(self._trigger("stop", event) !== false) { - self._clear(); + if(that._trigger("stop", event) !== false) { + that._clear(); } }); } else { @@ -558,7 +558,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { }, drag: function(event, ui) { - var inst = $(this).data("draggable"), self = this; + var inst = $(this).data("draggable"), that = this; var checkPos = function(o) { var dyClick = this.offset.click.top, dxClick = this.offset.click.left; @@ -585,7 +585,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { //Now we fake the start of dragging for the sortable instance, //by cloning the list group item, appending it to the sortable and using it as inst.currentItem //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it this.instance.options.helper = function() { return ui.helper[0]; }; |