mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-16 20:35:09 +00:00
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:
parent
a8838e4bae
commit
184d59e2bf
|
@ -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();
|
||||
|
|
|
@ -91,6 +91,8 @@
|
|||
};
|
||||
|
||||
MPP.unattach = function() {
|
||||
this.scroller.freezeHeight();
|
||||
|
||||
this.$title
|
||||
.add( this.title.$ellipsis )
|
||||
.add( this.$authorAndSource )
|
||||
|
|
|
@ -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() );
|
||||
|
|
Loading…
Reference in a new issue