mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Fix toolbar transition
The contents of the bar to should appear to move in to place, not just be revealed. Change-Id: I01a85e3455462cf70b6c3f25a236ab6cb82c706c
This commit is contained in:
parent
05ba32807f
commit
7b9229f5b8
|
@ -7,22 +7,28 @@
|
|||
|
||||
/* Toolbar */
|
||||
|
||||
.ve-activating .ve-init-mw-desktopArticleTarget-toolbar,
|
||||
.ve-deactivating .ve-init-mw-desktopArticleTarget-toolbar {
|
||||
.ve-init-mw-desktopArticleTarget-toolbar {
|
||||
overflow: hidden;
|
||||
transition: height 0.4s ease; /* stylelint-disable-line no-unsupported-browser-features */
|
||||
}
|
||||
|
||||
.ve-ui-toolbar-floating .oo-ui-toolbar-bar {
|
||||
.ve-init-mw-desktopArticleTarget-toolbar > .oo-ui-toolbar-bar {
|
||||
transform: translateY( -100% );
|
||||
transition: transform 0.4s ease; /* stylelint-disable-line no-unsupported-browser-features */
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.ve-active .ve-ui-toolbar-floating .oo-ui-toolbar-bar {
|
||||
.ve-init-mw-desktopArticleTarget-toolbar-opened {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.ve-init-mw-desktopArticleTarget-toolbar-open > .oo-ui-toolbar-bar {
|
||||
transform: translateY( 0 );
|
||||
}
|
||||
|
||||
.ve-ui-toolbar-floating > .oo-ui-toolbar-bar {
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
/*!
|
||||
* ve-redirect-header is added just outside of the surface, which has its own
|
||||
* hiding style during activation.
|
||||
|
|
|
@ -248,11 +248,14 @@ ve.init.mw.DesktopArticleTarget.prototype.setupToolbar = function ( surface ) {
|
|||
ve.track( 'trace.setupToolbar.exit' );
|
||||
if ( !wasSetup ) {
|
||||
setTimeout( function () {
|
||||
var height = toolbar.$bar.outerHeight();
|
||||
toolbar.$element.css( 'height', height );
|
||||
toolbar.$element
|
||||
.css( 'height', toolbar.$bar.outerHeight() )
|
||||
.addClass( 've-init-mw-desktopArticleTarget-toolbar-open' );
|
||||
setTimeout( function () {
|
||||
// Clear to allow growth during use and when resizing window
|
||||
toolbar.$element.css( 'height', '' );
|
||||
toolbar.$element
|
||||
.css( 'height', '' )
|
||||
.addClass( 've-init-mw-desktopArticleTarget-toolbar-opened' );
|
||||
target.toolbarSetupDeferred.resolve();
|
||||
}, 400 );
|
||||
} );
|
||||
|
@ -1153,7 +1156,10 @@ ve.init.mw.DesktopArticleTarget.prototype.teardownToolbar = function () {
|
|||
deferred = $.Deferred();
|
||||
this.toolbar.$element.css( 'height', this.toolbar.$bar.outerHeight() );
|
||||
setTimeout( function () {
|
||||
target.toolbar.$element.css( 'height', '0' );
|
||||
target.toolbar.$element
|
||||
.css( 'height', '0' )
|
||||
.removeClass( 've-init-mw-desktopArticleTarget-toolbar-open' )
|
||||
.removeClass( 've-init-mw-desktopArticleTarget-toolbar-opened' );
|
||||
setTimeout( function () {
|
||||
target.toolbar.destroy();
|
||||
target.toolbar = null;
|
||||
|
|
Loading…
Reference in a new issue