mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-12 09:27:36 +00:00
Fixes from MLB upstream
Bug: 56054 Bug: 56059 Change-Id: I549ba702c3b9bf9adec9fab692664eec1ff90005
This commit is contained in:
parent
ea778e990f
commit
4dd724838d
|
@ -26,7 +26,7 @@
|
|||
return ele;
|
||||
};
|
||||
|
||||
LIP.autoResize = function ( ele ) {
|
||||
LIP.autoResize = function ( ele, ratio ) {
|
||||
function updateRatios() {
|
||||
if ( imgHeight ) {
|
||||
imgHeightRatio = imgMaxHeight / imgHeight;
|
||||
|
@ -38,12 +38,13 @@
|
|||
}
|
||||
|
||||
var imgWidthRatio, imgHeightRatio,
|
||||
multRatio = ratio || 0.5,
|
||||
$window = $( window ),
|
||||
winWidth = $window.width(),
|
||||
winHeight = $window.height(),
|
||||
$img = $( ele ),
|
||||
imgMaxWidth = winWidth * 0.5,
|
||||
imgMaxHeight = winHeight * 0.5,
|
||||
imgMaxWidth = winWidth * multRatio,
|
||||
imgMaxHeight = winHeight * multRatio,
|
||||
imgWidth = $img.width(),
|
||||
imgHeight = $img.height();
|
||||
|
||||
|
|
|
@ -63,6 +63,9 @@
|
|||
if ( e.keyCode === 27 ) {
|
||||
// Escape button pressed
|
||||
lbinterface.unattach();
|
||||
if ( lbinterface.isFullScreen ) {
|
||||
lbinterface.fullscreen();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
|
@ -135,10 +138,10 @@
|
|||
iface.$imageDiv.html( ele );
|
||||
image.globalMaxWidth = iface.$image.width();
|
||||
image.globalMaxHeight = iface.$image.height();
|
||||
image.autoResize( ele );
|
||||
image.autoResize( ele, iface.isFullScreen ? 0.9 : 0.5 );
|
||||
|
||||
window.addEventListener( 'resize', function () {
|
||||
image.autoResize( ele );
|
||||
image.autoResize( ele, iface.isFullScreen ? 0.9 : 0.5 );
|
||||
} );
|
||||
|
||||
lightboxHooks.callAll( 'imageLoaded', iface );
|
||||
|
|
Loading…
Reference in a new issue