Replace animationend with setTimeout

Bug: 63253
Change-Id: Id4b998ad88bf27da8114f8194464bea8a11a0504
This commit is contained in:
Prateek Saxena 2014-04-11 16:49:12 +05:30
parent 783ae1ead7
commit cb41c8e6ff
2 changed files with 17 additions and 10 deletions

View file

@ -11,6 +11,13 @@
-moz-animation: @arguments;
-o-animation: @arguments;
animation: @arguments;
/* Leave the element in its final animation state */
-webkit-animation-fill-mode: forwards; /* Chrome 16+, Safari 4+ */
-moz-animation-fill-mode: forwards; /* FF 5+ */
-o-animation-fill-mode: forwards; /* not implemented yet */
-ms-animation-fill-mode: forwards; /* IE 10+ */
animation-fill-mode: forwards; /* when the spec is finished */
}
@-webkit-keyframes mwe-popups-fade-in {

View file

@ -350,16 +350,16 @@
$box
.removeClass( 'mwe-popups-fade-out mwe-popups-fade-in' )
.addClass( 'mwe-popups-fade-out' )
.on( 'webkitAnimationEnd oanimationend msAnimationEnd animationend', function () {
if ( $( this ).hasClass( 'mwe-popups-fade-out' ) ) {
$( this )
.off( 'webkitAnimationEnd oanimationend msAnimationEnd animationend' )
.removeClass( 'mwe-popups-fade-out' )
.attr( 'aria-hidden', 'true' )
.hide();
}
} );
.addClass( 'mwe-popups-fade-out' ); // Removed and added to trigger animation
setTimeout( function () {
if ( $box.hasClass( 'mwe-popups-fade-out' ) ) {
$box
.attr( 'aria-hidden', 'true' )
.hide()
.removeClass( 'mwe-popups-fade-out' );
}
}, 150 ); // Matches 0.15s in the .mwe-popups-fade-out class
if ( closeTimer ) {
clearTimeout( closeTimer );