Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Patch for jQuery 1.3.2 that makes animations work correctly when
working with different window contexts in Adobe AIR (1.5).
It causes the interval to be set on the window that belongs to
the element the animation is performed on.
===
@@ -4049,8 +4049,9 @@ jQuery.fx.prototype = {
t.elem = this.elem;
+ window = this.elem.ownerDocument.defaultView;
if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(function(){
+ timerId = window.setInterval(function(){
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
@@ -4058,7 +4059,7 @@ jQuery.fx.prototype = {
timers.splice(i--, 1);
if ( !timers.length ) {
- clearInterval( timerId );
+ window.clearInterval( timerId );
timerId = undefined;
}
}, 13);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.