Optimize notify hidden performance.

This commit is contained in:
Kenshin 2020-01-03 13:21:41 +08:00
parent ee26bb9737
commit 03064b18f7
2 changed files with 5 additions and 3 deletions

View File

@ -314,7 +314,7 @@ notify-gp .notify-snackbar {
to {
opacity: 0;
transform: translate3d(0, -100%, 0);
transform: scaleY(0);
}
}

View File

@ -144,8 +144,10 @@ var Notify = ( function () {
},
hidden = function( target ) {
target[0].addEventListener( 'animationend', function(e) {
target.remove();
if ($root.children().length === 0 ) $root.css( "z-index", 0 );
target.slideUp( 10, function() {
target.remove();
if ($root.children().length === 0 ) $root.css( "z-index", 0 );
});
}, false );
target.addClass( 'notify-hide' );
},