mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
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:
parent
b779743208
commit
011ff4e133
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue