diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index a2367667ddb..bf40560abb4 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1083,15 +1083,21 @@ function document_preview(file, type, title) console.log("Object width is small, we set width of popup according to image width."); popupWidth = object_width + 50 } - popupHeight = $( window ).height() * 0.90 - 100; + if (popupWidth < 250) { /* Set a minimal width because we need to have neough space for the buttons */ + popupWidth = 250; + } + + popupHeight = $( window ).height() * 0.90 - 160; console.log("object_height="+object_height+" popup window height="+popupHeight); - if (object_height < (popupHeight - 100)) { + if (object_height < (popupHeight - 160)) { console.log("Object height is small, we set height of popup according to image height."); - popupHeight = object_height + 100 + popupHeight = object_height + 160 } else { showOriginalSizeButton = true; } + console.log("popupWidth="+popupWidth+" popupHeight="+popupHeight); + show_preview('image'); }; @@ -1108,7 +1114,7 @@ function document_preview(file, type, title) var savMaxHeight = 0; optionsbuttons = { 'transnoentitiesnoconv("RotateImage")); ?>': function() { curRot += 90; jQuery(".ui-dialog-content.ui-widget-content > object").css("transform","rotate(" + curRot + "deg)"); }, - 'transnoentitiesnoconv("CloseWindow")); ?>': function() { $( this ).dialog( "close" ); } + 'transnoentitiesnoconv("CloseWindowShort")); ?>': function() { $( this ).dialog( "close" ); } }; if (showOriginalSizeButton) { optionsbuttons = { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6a33d6462e8..0c7b5a857d3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -718,6 +718,7 @@ SeeAll=See all Reason=Reason FeatureNotYetSupported=Feature not yet supported CloseWindow=Close window +CloseWindowShort=Close Response=Response Priority=Priority SendByMail=Send by email