N°5888 - Avoid modals being larger than window, when a modal is resized, recenter it

This commit is contained in:
Stephen Abello
2023-04-11 15:34:49 +02:00
parent c6d9fceff9
commit b7b578eee5
2 changed files with 16 additions and 1 deletions

View File

@@ -4,6 +4,8 @@
*/
/* SCSS variables */
$ibo-modal--max-height: 90vh !default;
$ibo-modal--max-width: 90vw !default;
$ibo-modal-option--do-not-show-again--margin-top: $ibo-spacing-500 !default;
$ibo-modal--is-informative--min-width: $ibo-size-700 !default;
@@ -13,6 +15,13 @@ $ibo-modal--is-informative--is-warning--highlight--background-color: $ibo-color-
$ibo-modal--is-informative--is-information--highlight--background-color: $ibo-color-blue-600 !default;
$ibo-modal--is-informative--is-success--highlight--background-color: $ibo-color-green-600 !default;
/* Avoid modals bigger than window size
!important in order to overload jQueryUI max-height:none being put on dialog elements */
.ibo-modal{
max-height: $ibo-modal--max-height !important;
max-width: $ibo-modal--max-width !important;
}
// Modal Option - Do not show again
.ibo-modal-option--do-not-show-again{
margin-top: $ibo-modal-option--do-not-show-again--margin-top;

View File

@@ -294,7 +294,13 @@ CombodoModal._InstantiateModal = function(oModalElem, oOptions) {
// Show modal
oModalElem.dialog(oJQueryOptions);
// - When resizing a window, center it
// TODO 3.1 move this to a BindEvents function
oModalElem.on('resize', function(){
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
});
// TODO 3.1 : Cleanup
// {
// height: 'auto',