Skip to content

Commit 4f909c5

Browse files
committed
Demos, Tests: Remove use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
1 parent 609243b commit 4f909c5

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

demos/accordion/hoverintent.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
3030
},
3131
handler: function( event ) {
32-
var self = this,
32+
var that = this,
3333
args = arguments,
3434
target = $( event.target ),
3535
cX, cY, pX, pY;
@@ -54,7 +54,7 @@
5454
// is fired asynchronously and the old event is no longer
5555
// usable (#6028)
5656
event.originalEvent = {};
57-
jQuery.event.handle.apply( self, args );
57+
jQuery.event.handle.apply( that, args );
5858
} else {
5959
pX = cX;
6060
pY = cY;

demos/autocomplete/categories.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
<script>
2323
$.widget( "custom.catcomplete", $.ui.autocomplete, {
2424
_renderMenu: function( ul, items ) {
25-
var self = this,
25+
var that = this,
2626
currentCategory = "";
2727
$.each( items, function( index, item ) {
2828
if ( item.category != currentCategory ) {
2929
ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
3030
currentCategory = item.category;
3131
}
32-
self._renderItem( ul, item );
32+
that._renderItem( ul, item );
3333
});
3434
}
3535
});

demos/autocomplete/combobox.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
(function( $ ) {
3030
$.widget( "ui.combobox", {
3131
_create: function() {
32-
var self = this,
32+
var that = this,
3333
select = this.element.hide(),
3434
selected = select.children( ":selected" ),
3535
value = selected.val() ? selected.text() : "";
@@ -85,7 +85,7 @@
8585
},
8686
select: function( event, ui ) {
8787
ui.item.option.selected = true;
88-
self._trigger( "selected", event, {
88+
that._trigger( "selected", event, {
8989
item: ui.item.option
9090
});
9191
},

tests/jquery.simulate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ $.extend( $.simulate.prototype, {
157157
},
158158

159159
drag: function( el ) {
160-
var self = this,
161-
center = this.findCenter(this.target),
160+
var center = this.findCenter(this.target),
162161
options = this.options,
163162
x = Math.floor( center.x ),
164163
y = Math.floor( center.y ),

tests/visual/menu/drilldown.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
$.widget("ui.drilldown", {
2323
_init: function() {
24-
var self = this;
24+
var that = this;
2525
this.active = this.element.find(">ul").attr("tabindex", 0);
2626

2727
// hide submenus and create indicator icons
@@ -31,18 +31,18 @@
3131
// disable built-in key handling
3232
input: $(),
3333
focus: function(event, ui) {
34-
self.activeItem = ui.item;
34+
that.activeItem = ui.item;
3535
},
3636
select: function(event, ui) {
37-
if (this != self.active[0]) {
37+
if (this != that.active[0]) {
3838
return;
3939
}
4040
var nested = $(">ul", ui.item);
4141
if (nested.length) {
42-
self._open(nested);
42+
that._open(nested);
4343
} else {
44-
self.element.find("h3").text(ui.item.text());
45-
self.options.select.apply(this, arguments);
44+
that.element.find("h3").text(ui.item.text());
45+
that.options.select.apply(this, arguments);
4646
}
4747
}
4848
});
@@ -52,7 +52,7 @@
5252
primary: "ui-icon-carat-1-w"
5353
}
5454
}).click(function() {
55-
self.up();
55+
that.up();
5656
return false;
5757
}).hide();
5858
},

0 commit comments

Comments
 (0)