git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #1827 bug where extra setInterval()s can be called during animation.
[jquery.git]
/
src
/
fx.js
diff --git
a/src/fx.js
b/src/fx.js
index
4ccb089
..
e4c1015
100644
(file)
--- a/
src/fx.js
+++ b/
src/fx.js
@@
-126,7
+126,7
@@
jQuery.fn.extend({
},
queue: function(type, fn){
},
queue: function(type, fn){
- if ( jQuery.isFunction(type) ) {
+ if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
fn = type;
type = "fx";
}
fn = type;
type = "fx";
}
@@
-162,6
+162,8
@@
var queue = function( elem, type, array ) {
if ( !elem )
return;
if ( !elem )
return;
+ type = type || "fx";
+
var q = jQuery.data( elem, type + "queue" );
if ( !q || array )
var q = jQuery.data( elem, type + "queue" );
if ( !q || array )
@@
-220,6
+222,7
@@
jQuery.extend({
},
timers: [],
},
timers: [],
+ timerId: null,
fx: function( elem, options, prop ){
this.options = options;
fx: function( elem, options, prop ){
this.options = options;
@@
-274,16
+277,18
@@
jQuery.fx.prototype = {
jQuery.timers.push(t);
jQuery.timers.push(t);
- if ( jQuery.timers.length == 1 ) {
- var timer = setInterval(function(){
+ if ( jQuery.timerId == null ) {
+ jQuery.timerId = setInterval(function(){
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
- if ( !timers.length )
- clearInterval( timer );
+ if ( !timers.length ) {
+ clearInterval( jQuery.timerId );
+ jQuery.timerId = null;
+ }
}, 13);
}
},
}, 13);
}
},