jquery fx & event: replaced the use of .apply(), where .call() could had been used.
This commit is contained in:
parent
440c08d768
commit
99101e02f9
2 changed files with 7 additions and 7 deletions
|
@ -495,7 +495,7 @@ jQuery.extend({
|
||||||
if ( jQuery.readyList ) {
|
if ( jQuery.readyList ) {
|
||||||
// Execute all of them
|
// Execute all of them
|
||||||
jQuery.each( jQuery.readyList, function(){
|
jQuery.each( jQuery.readyList, function(){
|
||||||
this.apply( document );
|
this.call( document );
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset the list of functions
|
// Reset the list of functions
|
||||||
|
|
12
src/fx.js
12
src/fx.js
|
@ -81,7 +81,7 @@ jQuery.fn.extend({
|
||||||
|
|
||||||
for ( p in prop ) {
|
for ( p in prop ) {
|
||||||
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
|
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
|
||||||
return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
|
return jQuery.isFunction(opt.complete) && opt.complete.call(this);
|
||||||
|
|
||||||
if ( p == "height" || p == "width" ) {
|
if ( p == "height" || p == "width" ) {
|
||||||
// Store display property
|
// Store display property
|
||||||
|
@ -148,7 +148,7 @@ jQuery.fn.extend({
|
||||||
queue(this, type).push( fn );
|
queue(this, type).push( fn );
|
||||||
|
|
||||||
if ( queue(this, type).length == 1 )
|
if ( queue(this, type).length == 1 )
|
||||||
fn.apply(this);
|
fn.call(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -202,7 +202,7 @@ jQuery.fn.dequeue = function(type){
|
||||||
q.shift();
|
q.shift();
|
||||||
|
|
||||||
if ( q.length )
|
if ( q.length )
|
||||||
q[0].apply( this );
|
q[0].call( this );
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ jQuery.extend({
|
||||||
if ( opt.queue !== false )
|
if ( opt.queue !== false )
|
||||||
jQuery(this).dequeue();
|
jQuery(this).dequeue();
|
||||||
if ( jQuery.isFunction( opt.old ) )
|
if ( jQuery.isFunction( opt.old ) )
|
||||||
opt.old.apply( this );
|
opt.old.call( this );
|
||||||
};
|
};
|
||||||
|
|
||||||
return opt;
|
return opt;
|
||||||
|
@ -260,7 +260,7 @@ jQuery.fx.prototype = {
|
||||||
// Simple function for setting a style value
|
// Simple function for setting a style value
|
||||||
update: function(){
|
update: function(){
|
||||||
if ( this.options.step )
|
if ( this.options.step )
|
||||||
this.options.step.apply( this.elem, [ this.now, this ] );
|
this.options.step.call( this.elem, this.now, this );
|
||||||
|
|
||||||
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
|
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ jQuery.fx.prototype = {
|
||||||
// If a callback was provided, execute it
|
// If a callback was provided, execute it
|
||||||
if ( done && jQuery.isFunction( this.options.complete ) )
|
if ( done && jQuery.isFunction( this.options.complete ) )
|
||||||
// Execute the complete function
|
// Execute the complete function
|
||||||
this.options.complete.apply( this.elem );
|
this.options.complete.call( this.elem );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue