mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Fix size of image popup for small images
This commit is contained in:
@@ -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 = {
|
||||
'<?php echo dol_escape_js($langs->transnoentitiesnoconv("RotateImage")); ?>': function() { curRot += 90; jQuery(".ui-dialog-content.ui-widget-content > object").css("transform","rotate(" + curRot + "deg)"); },
|
||||
'<?php echo dol_escape_js($langs->transnoentitiesnoconv("CloseWindow")); ?>': function() { $( this ).dialog( "close" ); }
|
||||
'<?php echo dol_escape_js($langs->transnoentitiesnoconv("CloseWindowShort")); ?>': function() { $( this ).dialog( "close" ); }
|
||||
};
|
||||
if (showOriginalSizeButton) {
|
||||
optionsbuttons = {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user