Fix clipping of text when metadata panel is closed

The first item (license) of the list on the right side of the
metadata panel wasn't large enough (due to some recent global style
change that I couldn't track down) and the top of the next item was
visible. Added fixed height to prevent that. Also centered the
credit/license text which looked sloppy.

Bug: T101391
Change-Id: I848917ebb9c378c3210646486a87a6497d31a168
This commit is contained in:
Gergő Tisza 2015-06-19 00:16:16 +00:00
parent e5ec79f2de
commit 0e9cfb5de0
2 changed files with 17 additions and 5 deletions

View file

@ -126,6 +126,9 @@
this.canvas.empty();
this.buttons.empty();
this.$main.addClass( 'metadata-panel-is-closed' )
.removeClass( 'metadata-panel-is-open' );
};
/**
@ -205,9 +208,11 @@
// cross-communication between panel and canvas, sort of
this.$postDiv.on( 'mmv-metadata-open.lip', function () {
ui.$main.addClass( 'metadata-panel-is-open' );
ui.$main.addClass( 'metadata-panel-is-open' )
.removeClass( 'metadata-panel-is-closed' );
} ).on( 'mmv-metadata-close.lip', function () {
ui.$main.removeClass( 'metadata-panel-is-open' );
ui.$main.removeClass( 'metadata-panel-is-open' )
.addClass( 'metadata-panel-is-closed' );
} );
this.$wrapper.on( 'mmv-panel-close-area-click.lip', function () {
ui.panel.scroller.toggle( 'down' );

View file

@ -72,10 +72,10 @@
color: #555;
padding: 0 0 @padding-right;
font-size: 0.85em;
height: @metadatabar-below-fold-pushup-height - @space-above-credit - @fold-separator-border-width; // needs explicit height for text truncation logic
&.mw-mmv-ttf-untruncated {
height: auto;
.metadata-panel-is-closed {
height: @metadatabar-below-fold-pushup-height - @space-above-credit - @fold-separator-border-width; // needs explicit height for text truncation logic
line-height: @metadatabar-below-fold-pushup-height - @space-above-credit - @fold-separator-border-width;
}
&.empty {
@ -173,6 +173,13 @@
display: none;
}
// Make sure the next list item is not visible when the
// metadata panel is closed
.metadata-panel-is-closed &.mw-mmv-license-li {
height: @metadatabar-below-fold-pushup-height - @space-above-credit;
line-height: @metadatabar-below-fold-pushup-height - @space-above-credit;
}
&:before {
display: inline-block;
vertical-align: middle;