mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-14 11:16:44 +00:00
Move mmv-close event trigger higher up in lightboxinterface/unattach
This avoids a bug with Firefox's automatic scroll restoration logic, which seems to always jump to the top of the page upon closing MMV. Bug: T229484 Change-Id: Ia4261ce268df4d8fb07b4813a6ae72ad88728e91
This commit is contained in:
parent
6bdae911b8
commit
ca1364928c
|
@ -253,6 +253,14 @@
|
||||||
LIP.unattach = function () {
|
LIP.unattach = function () {
|
||||||
mw.mmv.actionLogger.log( 'close' );
|
mw.mmv.actionLogger.log( 'close' );
|
||||||
|
|
||||||
|
// We trigger this event on the document because unattach() can run
|
||||||
|
// when the interface is unattached
|
||||||
|
// We're calling this before cleaning up (below) the DOM, as that
|
||||||
|
// appears to have an impact on automatic scroll restoration (which
|
||||||
|
// might happen as a result of this being closed) in FF
|
||||||
|
$( document ).trigger( $.Event( 'mmv-close' ) )
|
||||||
|
.off( 'jq-fullscreen-change.lip' );
|
||||||
|
|
||||||
// Has to happen first so that the scroller can freeze with visible elements
|
// Has to happen first so that the scroller can freeze with visible elements
|
||||||
this.panel.unattach();
|
this.panel.unattach();
|
||||||
|
|
||||||
|
@ -284,11 +292,6 @@
|
||||||
prev: [ 'emit', 'prev' ]
|
prev: [ 'emit', 'prev' ]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// We trigger this event on the document because unattach() can run
|
|
||||||
// when the interface is unattached
|
|
||||||
$( document ).trigger( $.Event( 'mmv-close' ) )
|
|
||||||
.off( 'jq-fullscreen-change.lip' );
|
|
||||||
|
|
||||||
this.attached = false;
|
this.attached = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue