mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Demos, Tests: Remove use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
This commit is contained in:
parent
609243b21d
commit
4f909c50ba
@ -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;
|
||||
|
@ -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 );
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -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
|
||||
});
|
||||
},
|
||||
|
@ -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 ),
|
||||
|
@ -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();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user