Make sure that the metadata panel isn't expanded by default in IE

Also fixes issue where stale scroll state from previous image
could be memorised and recalled when closing/reopening MV.

Change-Id: Id29c7b28887afebcb742f49b4d7c20e1210e6c1d
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/996
Bug: 73337
This commit is contained in:
Gilles Dubuc 2014-11-13 09:55:12 +01:00 committed by Gergő Tisza
parent a8838e4bae
commit 184d59e2bf
3 changed files with 13 additions and 2 deletions

View file

@ -224,12 +224,13 @@
LIP.unattach = function () {
mw.mmv.actionLogger.log( 'close' );
// Has to happen first so that the scroller can freeze with visible elements
this.panel.unattach();
this.$wrapper.detach();
this.currentlyAttached = false;
this.panel.unattach();
this.canvas.unattach();
this.buttons.unattach();

View file

@ -91,6 +91,8 @@
};
MPP.unattach = function() {
this.scroller.freezeHeight();
this.$title
.add( this.title.$ellipsis )
.add( this.$authorAndSource )

View file

@ -114,6 +114,10 @@
* unfreezeHeight after the panel has been populeted with the new metadata.
*/
MPSP.freezeHeight = function () {
if ( !this.$container.is( ':visible' ) ) {
return;
}
var scrollTop = $.scrollTo().scrollTop(),
scrollTopWhenOpen = this.getScrollTopWhenOpen();
@ -122,6 +126,10 @@
};
MPSP.unfreezeHeight = function () {
if ( !this.$container.is( ':visible' ) ) {
return;
}
this.$container.css( 'min-height', '' );
if ( this.panelWasFullyOpen ) {
$.scrollTo( this.getScrollTopWhenOpen() );