popup fix scrollbar style, align toastr

This commit is contained in:
Wolfsblvt 2024-05-30 21:03:52 +02:00
parent 6c3118549f
commit 1c6671df31
3 changed files with 38 additions and 9 deletions

View File

@ -4849,7 +4849,7 @@
<!-- various fullscreen popups --> <!-- various fullscreen popups -->
<template id="shadow_popup_template" data-i18n="[popup_text_save]popup_text_save;[popup_text_yes]popup_text_yes;[popup_text_no]popup_text_no;[popup_text_cancel]popup_text_cancel;[popup_text_import]popup_text_import" popup_text_save="Save" popup_text_yes="Yes" popup_text_no="No" popup_text_cancel="Cancel" popup_text_import="Import"> <!-- localization data holder for popups --> <template id="shadow_popup_template" data-i18n="[popup_text_save]popup_text_save;[popup_text_yes]popup_text_yes;[popup_text_no]popup_text_no;[popup_text_cancel]popup_text_cancel;[popup_text_import]popup_text_import" popup_text_save="Save" popup_text_yes="Yes" popup_text_no="No" popup_text_cancel="Cancel" popup_text_import="Import"> <!-- localization data holder for popups -->
<dialog class="dialogue_popup shadow_popup"> <dialog class="dialogue_popup shadow_popup">
<div class="popup_content">
<div class="dialogue_popup_text"> <div class="dialogue_popup_text">
<h3 class="margin0">text</h3> <h3 class="margin0">text</h3>
</div> </div>
@ -4858,7 +4858,7 @@
<div class="dialogue_popup_ok menu_button result_control" data-i18n="Delete" data-result="1" tabindex="0">Delete</div> <div class="dialogue_popup_ok menu_button result_control" data-i18n="Delete" data-result="1" tabindex="0">Delete</div>
<div class="dialogue_popup_cancel menu_button result_control" data-i18n="Cancel" data-result="0" tabindex="0">Cancel</div> <div class="dialogue_popup_cancel menu_button result_control" data-i18n="Cancel" data-result="0" tabindex="0">Cancel</div>
</div> </div>
</div>
</dialog> </dialog>
</template> </template>
<div id="shadow_popup"> <div id="shadow_popup">

View File

@ -49,6 +49,7 @@ export class Popup {
/** @type {string} */ id; /** @type {string} */ id;
/** @type {HTMLDialogElement} */ dlg; /** @type {HTMLDialogElement} */ dlg;
/** @type {HTMLElement} */ content;
/** @type {HTMLElement} */ text; /** @type {HTMLElement} */ text;
/** @type {HTMLTextAreaElement} */ input; /** @type {HTMLTextAreaElement} */ input;
/** @type {HTMLElement} */ controls; /** @type {HTMLElement} */ controls;
@ -84,6 +85,7 @@ export class Popup {
const template = document.querySelector('#shadow_popup_template'); const template = document.querySelector('#shadow_popup_template');
// @ts-ignore // @ts-ignore
this.dlg = template.content.cloneNode(true).querySelector('.dialogue_popup'); this.dlg = template.content.cloneNode(true).querySelector('.dialogue_popup');
this.content = this.dlg.querySelector('.popup_content');
this.text = this.dlg.querySelector('.dialogue_popup_text'); this.text = this.dlg.querySelector('.dialogue_popup_text');
this.input = this.dlg.querySelector('.dialogue_popup_input'); this.input = this.dlg.querySelector('.dialogue_popup_input');
this.controls = this.dlg.querySelector('.dialogue_popup_controls'); this.controls = this.dlg.querySelector('.dialogue_popup_controls');

View File

@ -3064,8 +3064,9 @@ dialog {
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden;
overflow-x: hidden; /* Overflow visible so elements (like toasts) can appear outside of the dialog. '.popup_content' is hiding overflow for the real content. */
overflow: visible;
/* Fix weird animation issue with font-scaling during popup open */ /* Fix weird animation issue with font-scaling during popup open */
backface-visibility: hidden; backface-visibility: hidden;
@ -3073,6 +3074,25 @@ dialog {
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
} }
.dialogue_popup .popup_content {
display: flex;
flex-direction: column;
overflow: hidden;
}
.dialogue_popup .dialogue_popup_text {
padding: 0 8px;
overflow: hidden;
}
.dialogue_popup.vertical_scrolling_dialogue_popup .dialogue_popup_text {
overflow-y: auto;
}
.dialogue_popup.horizontal_scrolling_dialogue_popup .dialogue_popup_text {
overflow-x: auto;
}
/* Open state of the dialog */ /* Open state of the dialog */
.dialogue_popup[open] { .dialogue_popup[open] {
animation: pop-in var(--animation-duration-slow) ease-in-out; animation: pop-in var(--animation-duration-slow) ease-in-out;
@ -3108,7 +3128,7 @@ dialog {
transform: scaleY(0); transform: scaleY(0);
} }
/** Make the scaling faster on pop-in, otherwise it looks a bit weird **/ /* Make the scaling faster on pop-in, otherwise it looks a bit weird */
33% { 33% {
transform: scaleY(1); transform: scaleY(1);
} }
@ -3131,6 +3151,14 @@ dialog {
} }
} }
/* Fix toastr in dialogs by actually placing it at the top of the screen via transform */
.dialogue_popup #toast-container {
height: 100svh;
top: calc(50% + var(--topBarBlockSize));
left: 50%;
transform: translate(-50%, -50%);
}
.rm_stat_block { .rm_stat_block {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -3153,11 +3181,11 @@ dialog {
min-width: 750px; min-width: 750px;
} }
.horizontal_scrolling_dialogue_popup { #dialogue_popup .horizontal_scrolling_dialogue_popup {
overflow-x: unset !important; overflow-x: unset !important;
} }
.vertical_scrolling_dialogue_popup { #dialogue_popup .vertical_scrolling_dialogue_popup {
overflow-y: unset !important; overflow-y: unset !important;
} }
@ -3170,8 +3198,7 @@ dialog {
padding: 0 10px; padding: 0 10px;
} }
#dialogue_popup_text, #dialogue_popup_text {
.dialogue_popup_text {
flex-grow: 1; flex-grow: 1;
overflow-y: auto; overflow-y: auto;
height: 100%; height: 100%;