mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +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.");
|
console.log("Object width is small, we set width of popup according to image width.");
|
||||||
popupWidth = object_width + 50
|
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);
|
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.");
|
console.log("Object height is small, we set height of popup according to image height.");
|
||||||
popupHeight = object_height + 100
|
popupHeight = object_height + 160
|
||||||
} else {
|
} else {
|
||||||
showOriginalSizeButton = true;
|
showOriginalSizeButton = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("popupWidth="+popupWidth+" popupHeight="+popupHeight);
|
||||||
|
|
||||||
show_preview('image');
|
show_preview('image');
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1108,7 +1114,7 @@ function document_preview(file, type, title)
|
|||||||
var savMaxHeight = 0;
|
var savMaxHeight = 0;
|
||||||
optionsbuttons = {
|
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("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) {
|
if (showOriginalSizeButton) {
|
||||||
optionsbuttons = {
|
optionsbuttons = {
|
||||||
|
|||||||
@@ -718,6 +718,7 @@ SeeAll=See all
|
|||||||
Reason=Reason
|
Reason=Reason
|
||||||
FeatureNotYetSupported=Feature not yet supported
|
FeatureNotYetSupported=Feature not yet supported
|
||||||
CloseWindow=Close window
|
CloseWindow=Close window
|
||||||
|
CloseWindowShort=Close
|
||||||
Response=Response
|
Response=Response
|
||||||
Priority=Priority
|
Priority=Priority
|
||||||
SendByMail=Send by email
|
SendByMail=Send by email
|
||||||
|
|||||||
Reference in New Issue
Block a user