Skip to content

Commit c1bc711

Browse files
committed
Effects: Fix a timing issue in a variable declaration
A jQuery object was created, chained & assigned to a variable that was then accessed in a callback used inside of this chained definition. Due to a timing difference in when the callback fired for the first time in latest jQuery master, it was being called before the variable was defined. This has been resolved now.
1 parent bd9779c commit c1bc711

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

ui/effect.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,22 +1531,24 @@ $.fn.extend( {
15311531
width: target.innerWidth()
15321532
},
15331533
startPosition = element.offset(),
1534-
transfer = $( "<div class='ui-effects-transfer'></div>" )
1535-
.appendTo( "body" )
1536-
.addClass( options.className )
1537-
.css( {
1538-
top: startPosition.top - fixTop,
1539-
left: startPosition.left - fixLeft,
1540-
height: element.innerHeight(),
1541-
width: element.innerWidth(),
1542-
position: targetFixed ? "fixed" : "absolute"
1543-
} )
1544-
.animate( animation, options.duration, options.easing, function() {
1545-
transfer.remove();
1546-
if ( typeof done === "function" ) {
1547-
done();
1548-
}
1549-
} );
1534+
transfer = $( "<div class='ui-effects-transfer'></div>" );
1535+
1536+
transfer
1537+
.appendTo( "body" )
1538+
.addClass( options.className )
1539+
.css( {
1540+
top: startPosition.top - fixTop,
1541+
left: startPosition.left - fixLeft,
1542+
height: element.innerHeight(),
1543+
width: element.innerWidth(),
1544+
position: targetFixed ? "fixed" : "absolute"
1545+
} )
1546+
.animate( animation, options.duration, options.easing, function() {
1547+
transfer.remove();
1548+
if ( typeof done === "function" ) {
1549+
done();
1550+
}
1551+
} );
15501552
}
15511553
} );
15521554

0 commit comments

Comments
 (0)