Skip to content

Commit 7e78572

Browse files
committed
Effects Rewrite: ensure fold and blind animate the placeholder
1 parent 766afa3 commit 7e78572

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

ui/effect-blind.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ return $.effects.define( "blind", "hide", function( o, done ) {
4646

4747
if ( show ) {
4848
el.cssClip( animate.clip );
49+
if ( placeholder ) {
50+
placeholder.css( $.effects.clipToBox( animate ) );
51+
}
52+
4953
animate.clip = start;
5054
}
5155

56+
if ( placeholder ) {
57+
placeholder.animate( $.effects.clipToBox( animate ), o.duration, o.easing );
58+
}
59+
5260
el.animate( animate, {
5361
queue: false,
5462
duration: o.duration,

ui/effect-fold.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,24 @@ return $.effects.define( "fold", "hide", function( o, done ) {
6262

6363
if ( show ) {
6464
el.cssClip( animation2.clip );
65+
if ( placeholder ) {
66+
placeholder.css( $.effects.clipToBox( animation2 ) );
67+
}
68+
6569
animation2.clip = start;
6670
}
6771

6872
// Animate
6973
el
74+
.queue(function(next) {
75+
if ( placeholder ) {
76+
placeholder
77+
.animate( $.effects.clipToBox( animation1 ), duration, o.easing )
78+
.animate( $.effects.clipToBox( animation2 ), duration, o.easing );
79+
}
80+
81+
next();
82+
})
7083
.animate( animation1, duration, o.easing )
7184
.animate( animation2, duration, o.easing )
7285
.queue(function() {
@@ -82,7 +95,7 @@ return $.effects.define( "fold", "hide", function( o, done ) {
8295
// inject all the animations we just queued to be first in line (after "inprogress")
8396
if ( queuelen > 1) {
8497
queue.splice.apply( queue,
85-
[ 1, 0 ].concat( queue.splice( queuelen, 3 ) ) );
98+
[ 1, 0 ].concat( queue.splice( queuelen, 4 ) ) );
8699
}
87100
el.dequeue();
88101
});

ui/effect.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,15 @@ $.extend( $.effects, {
10501050
return effect;
10511051
},
10521052

1053+
clipToBox: function( animation ) {
1054+
return {
1055+
width: animation.clip.right - animation.clip.left,
1056+
height: animation.clip.bottom - animation.clip.top,
1057+
left: animation.clip.left,
1058+
top: animation.clip.top
1059+
};
1060+
},
1061+
10531062
saveStyle: function( element ) {
10541063
element.data( dataSpaceStyle, element[ 0 ].style.cssText );
10551064
},

0 commit comments

Comments
 (0)