mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-25 08:35:29 +00:00
Fix fullscreen bug where image was replaced with self
Change-Id: I81dcadae96a778559564a786a5753323fb802b7c
This commit is contained in:
parent
2b450f2e15
commit
d7706d7cb0
|
@ -156,6 +156,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
LIP.replaceImageWith = function ( imageEle ) {
|
LIP.replaceImageWith = function ( imageEle ) {
|
||||||
|
if ( this.$image.is( imageEle ) ) { // http://bugs.jquery.com/ticket/4087
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var $image = $( imageEle );
|
var $image = $( imageEle );
|
||||||
|
|
||||||
this.currentImage.src = imageEle.src;
|
this.currentImage.src = imageEle.src;
|
||||||
|
@ -178,8 +182,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.viewer.resize( this );
|
|
||||||
|
|
||||||
if ( this.isFullscreen ) {
|
if ( this.isFullscreen ) {
|
||||||
// When entering fullscreen without a mousemove, the browser
|
// When entering fullscreen without a mousemove, the browser
|
||||||
// still thinks that the cursor is where it was prior to entering
|
// still thinks that the cursor is where it was prior to entering
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
|
|
||||||
if ( this.resizeListener ) {
|
if ( this.resizeListener ) {
|
||||||
window.removeEventListener( 'resize', this.resizeListener );
|
window.removeEventListener( 'resize', this.resizeListener );
|
||||||
|
this.resizeListener = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -167,9 +168,10 @@
|
||||||
|
|
||||||
// Capture listener so we can remove it later, otherwise
|
// Capture listener so we can remove it later, otherwise
|
||||||
// we are going to leak listeners !
|
// we are going to leak listeners !
|
||||||
|
if ( !this.resizeListener ) {
|
||||||
this.resizeListener = function () { iface.resizeCallback(); };
|
this.resizeListener = function () { iface.resizeCallback(); };
|
||||||
|
|
||||||
window.addEventListener( 'resize', this.resizeListener );
|
window.addEventListener( 'resize', this.resizeListener );
|
||||||
|
}
|
||||||
|
|
||||||
lightboxHooks.callAll( 'imageLoaded', this );
|
lightboxHooks.callAll( 'imageLoaded', this );
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue