diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:14:36 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-12 09:14:36 -0500 |
commit | 4f909c50bad9cbdf4789d272ada71c51fa1226d3 (patch) | |
tree | 754a41f9ad982dcd9be686521fb18f8d030c269b | |
parent | 609243b21d2530ecd5e8e19e99951decc8587285 (diff) | |
download | jquery-ui-4f909c50bad9cbdf4789d272ada71c51fa1226d3.tar.gz jquery-ui-4f909c50bad9cbdf4789d272ada71c51fa1226d3.zip |
Demos, Tests: Remove use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
-rw-r--r-- | demos/accordion/hoverintent.html | 4 | ||||
-rw-r--r-- | demos/autocomplete/categories.html | 4 | ||||
-rw-r--r-- | demos/autocomplete/combobox.html | 4 | ||||
-rw-r--r-- | tests/jquery.simulate.js | 3 | ||||
-rw-r--r-- | tests/visual/menu/drilldown.html | 14 |
5 files changed, 14 insertions, 15 deletions
diff --git a/demos/accordion/hoverintent.html b/demos/accordion/hoverintent.html index 184951cf2..8f628bda8 100644 --- a/demos/accordion/hoverintent.html +++ b/demos/accordion/hoverintent.html @@ -29,7 +29,7 @@ $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler ); }, handler: function( event ) { - var self = this, + var that = this, args = arguments, target = $( event.target ), cX, cY, pX, pY; @@ -54,7 +54,7 @@ // is fired asynchronously and the old event is no longer // usable (#6028) event.originalEvent = {}; - jQuery.event.handle.apply( self, args ); + jQuery.event.handle.apply( that, args ); } else { pX = cX; pY = cY; diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index 2eead8ad2..902867478 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -22,14 +22,14 @@ <script> $.widget( "custom.catcomplete", $.ui.autocomplete, { _renderMenu: function( ul, items ) { - var self = this, + var that = this, currentCategory = ""; $.each( items, function( index, item ) { if ( item.category != currentCategory ) { ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); currentCategory = item.category; } - self._renderItem( ul, item ); + that._renderItem( ul, item ); }); } }); diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index aeaee5c4c..27ef92d4e 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -29,7 +29,7 @@ (function( $ ) { $.widget( "ui.combobox", { _create: function() { - var self = this, + var that = this, select = this.element.hide(), selected = select.children( ":selected" ), value = selected.val() ? selected.text() : ""; @@ -85,7 +85,7 @@ }, select: function( event, ui ) { ui.item.option.selected = true; - self._trigger( "selected", event, { + that._trigger( "selected", event, { item: ui.item.option }); }, diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index a8740e6b8..43614dd0a 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -157,8 +157,7 @@ $.extend( $.simulate.prototype, { }, drag: function( el ) { - var self = this, - center = this.findCenter(this.target), + var center = this.findCenter(this.target), options = this.options, x = Math.floor( center.x ), y = Math.floor( center.y ), diff --git a/tests/visual/menu/drilldown.html b/tests/visual/menu/drilldown.html index a2ae9e88f..781f5d88a 100644 --- a/tests/visual/menu/drilldown.html +++ b/tests/visual/menu/drilldown.html @@ -21,7 +21,7 @@ $.widget("ui.drilldown", { _init: function() { - var self = this; + var that = this; this.active = this.element.find(">ul").attr("tabindex", 0); // hide submenus and create indicator icons @@ -31,18 +31,18 @@ // disable built-in key handling input: $(), focus: function(event, ui) { - self.activeItem = ui.item; + that.activeItem = ui.item; }, select: function(event, ui) { - if (this != self.active[0]) { + if (this != that.active[0]) { return; } var nested = $(">ul", ui.item); if (nested.length) { - self._open(nested); + that._open(nested); } else { - self.element.find("h3").text(ui.item.text()); - self.options.select.apply(this, arguments); + that.element.find("h3").text(ui.item.text()); + that.options.select.apply(this, arguments); } } }); @@ -52,7 +52,7 @@ primary: "ui-icon-carat-1-w" } }).click(function() { - self.up(); + that.up(); return false; }).hide(); }, |