Fix bug: "dancing vector tabs"

Related: I0672b05bc3eb9564e1943ee8099bafb959dc474d
"Cannot rename `.emptyPortlet` to `.vector-menu-empty` yet." This is the JS part.
Given the regression, we can't make this rename just yet. Restore
the old class, we'll deal with this rename later.

Bug: T253819
Change-Id: Ia6bb33be807bfe98de09ce0b61924da232fc9941
This commit is contained in:
AronDemian 2020-05-30 16:49:57 +02:00 committed by Umherirrender
parent ce79b63436
commit bdffc10fbb
1 changed files with 4 additions and 4 deletions

View File

@ -28,8 +28,8 @@ function init() {
var expandedWidth;
// If the dropdown was hidden, show it
// eslint-disable-next-line no-jquery/no-class-state
if ( $cactions.hasClass( 'vector-menu-empty' ) ) {
$cactions.removeClass( 'vector-menu-empty' );
if ( $cactions.hasClass( 'emptyPortlet' ) ) {
$cactions.removeClass( 'emptyPortlet vector-menu-empty' );
// Now that it is visible, force-render it virtually
// to get its expanded width, then shrink it 1px before we
// yield from JS (which means the expansion won't be visible).
@ -47,7 +47,7 @@ function init() {
// eslint-disable-next-line no-jquery/no-animate
$cactions.find( 'h3' ).animate( { width: '1px' }, 'normal', function () {
$( this ).attr( 'style', '' )
.parent().addClass( 'vector-menu-empty' );
.parent().addClass( 'emptyPortlet vector-menu-empty' );
} );
}
} )
@ -86,7 +86,7 @@ function init() {
// Always collapse if the "More" button is already shown.
// eslint-disable-next-line no-jquery/no-class-state
if ( !$cactions.hasClass( 'vector-menu-empty' ) ) {
if ( !$cactions.hasClass( 'emptyPortlet' ) ) {
return true;
}