Replace transitionend event with setTimeout

transitionend events seem like a neater solution, but we should
migrate all of our code at once, and provide a polyfill for
browsers which don't support it (IE9).

Change-Id: If6ae030856f8e69cc8bb26f21bfed30d5d22775c
This commit is contained in:
Ed Sanders 2016-04-14 16:09:51 +01:00
parent b779743208
commit 011ff4e133

View file

@ -191,11 +191,11 @@ ve.init.mw.DesktopArticleTarget.prototype.setupToolbar = function ( surface ) {
setTimeout( function () {
var height = toolbar.$bar.outerHeight();
toolbar.$element.css( 'height', height );
toolbar.$element.one( 'transitionend', function () {
setTimeout( function () {
// Clear to allow growth during use and when resizing window
toolbar.$element.css( 'height', '' );
target.toolbarSetupDeferred.resolve();
} );
}, 400 );
} );
this.toolbarSetupDeferred.done( function () {
@ -1053,11 +1053,11 @@ ve.init.mw.DesktopArticleTarget.prototype.teardownToolbar = function () {
this.toolbar.$element.css( 'height', this.toolbar.$bar.outerHeight() );
setTimeout( function () {
target.toolbar.$element.css( 'height', '0' );
target.toolbar.$element.one( 'transitionend', function () {
setTimeout( function () {
target.toolbar.destroy();
target.toolbar = null;
deferred.resolve();
} );
}, 400 );
} );
return deferred.promise();
};