mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°5888 - Avoid modals being larger than window, when a modal is resized, recenter it
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user