Skip to content
Permalink
Browse files

Demos, Tests: Remove use 'that' instead of 'self'. Partial fix for #5…

…404 - remove uses of 'var self = this;'
  • Loading branch information
scottgonzalez committed Feb 12, 2012
1 parent 609243b commit 4f909c50bad9cbdf4789d272ada71c51fa1226d3
@@ -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();
},

0 comments on commit 4f909c5

Please sign in to comment.
You can’t perform that action at this time.