css fixes for modal dialog

This commit is contained in:
maxpozdeev 2022-11-13 18:44:31 +03:00
parent f10ee503f8
commit 068335c2ad
2 changed files with 6 additions and 3 deletions

View file

@ -2821,6 +2821,7 @@ function mttModalDialog(dialogType = 'alert')
this.close = function() {
$("#modal_overlay, #modal").hide();
$('html').css('overflow-y', '');
$("#btnModalOk").off('click');
$("#btnModalCancel").off('click');
$("#modalMessage").text('');
@ -2858,11 +2859,12 @@ function mttModalDialog(dialogType = 'alert')
}
this.show = function() {
$('html').css('overflow-y', 'hidden'); // disable scrolling
var modalOverlay = document.getElementById("modal_overlay");
if (!modalOverlay) {
modalOverlay = document.createElement("div");
modalOverlay.id = "modal_overlay";
modalOverlay.style.cssText = "position: absolute; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; background-color: black; opacity: 0.8; display:none;";
modalOverlay.style.cssText = "position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; background-color: black; opacity: 0.8; display:none;";
document.getElementsByTagName('body')[0].appendChild(modalOverlay);
}

View file

@ -103,7 +103,7 @@
html {
height:100%;
overflow-y:hidden; /* for modal overlay */
/*overflow-y:hidden; /* for modal overlay to not hide body scrollbar */
font-size:14px; /* =1rem */
}
body {
@ -985,7 +985,7 @@ li.mtt-item-hidden { display:none; }
}
#modal {
position: absolute;
position: fixed;
z-index: 1000;
left: 50%;
top: 50%;
@ -1125,6 +1125,7 @@ li.mtt-item-hidden { display:none; }
}
#modal {
min-width: auto;
width: 90%;
}