Place the dialog close button on the outer corner #58
No files matched your search
@@ -313,7 +313,9 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
|
|||||||
|
|
||||||
<?php // Slide form in a dialog (loaded via fetch, see [data-modal] in plenario.js); without JS the links open the full page. ?>
|
<?php // Slide form in a dialog (loaded via fetch, see [data-modal] in plenario.js); without JS the links open the full page. ?>
|
||||||
<dialog class="modal" data-modal-dialog aria-labelledby="modal-title">
|
<dialog class="modal" data-modal-dialog aria-labelledby="modal-title">
|
||||||
<button type="button" class="modal__close button button--ghost button--icon" data-modal-close
|
<button type="button" class="modal__close" data-modal-close
|
||||||
aria-label="<?= h(__('Schließen')) ?>" title="<?= h(__('Schließen (Esc)')) ?>">✕</button>
|
aria-label="<?= h(__('Schließen')) ?>" title="<?= h(__('Schließen (Esc)')) ?>">✕</button>
|
||||||
|
<div class="modal__panel" data-modal-panel>
|
||||||
<div data-modal-body></div>
|
<div data-modal-body></div>
|
||||||
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -734,14 +734,24 @@ body.present {
|
|||||||
.theme-switch__icon { font-size: 1.3em; line-height: 1; }
|
.theme-switch__icon { font-size: 1.3em; line-height: 1; }
|
||||||
|
|
||||||
/* Slide form in a dialog (admin dashboard) */
|
/* Slide form in a dialog (admin dashboard) */
|
||||||
.modal {
|
/* The dialog itself does not scroll (overflow visible), so the close button can sit on its outer corner;
|
||||||
width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
|
the inner panel carries border, background and scrolling. */
|
||||||
border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
|
.modal { width: min(720px, calc(100vw - 24px)); padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
|
||||||
|
.modal::backdrop { background: rgba(10, 12, 30, .55); }
|
||||||
|
.modal__panel {
|
||||||
|
max-height: calc(100dvh - 24px); overflow: auto;
|
||||||
|
border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
|
||||||
box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
|
box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
|
||||||
}
|
}
|
||||||
.modal::backdrop { background: rgba(10, 12, 30, .55); }
|
|
||||||
.modal .card--form { max-width: none; margin: 0; border: 0; box-shadow: none; background: transparent; }
|
.modal .card--form { max-width: none; margin: 0; border: 0; box-shadow: none; background: transparent; }
|
||||||
.modal__close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; z-index: 1; }
|
.modal__close {
|
||||||
|
position: absolute; top: -14px; right: -14px; z-index: 1; width: 36px; height: 36px; padding: 0;
|
||||||
|
display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%;
|
||||||
|
background: var(--surface); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
.modal__close:hover { background: var(--surface-2); }
|
||||||
|
.modal__close:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
|
||||||
.modal .message { margin: 16px 16px 0; cursor: default; }
|
.modal .message { margin: 16px 16px 0; cursor: default; }
|
||||||
body:has(dialog[open]) { overflow: hidden; }
|
body:has(dialog[open]) { overflow: hidden; }
|
||||||
.slide-item__actions form { display: contents; }
|
.slide-item__actions form { display: contents; }
|
||||||
|
|||||||
@@ -2586,7 +2586,7 @@
|
|||||||
if (!dialog.open) {
|
if (!dialog.open) {
|
||||||
dialog.showModal();
|
dialog.showModal();
|
||||||
}
|
}
|
||||||
dialog.scrollTop = 0;
|
dialog.querySelector('[data-modal-panel]').scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestClose() {
|
function requestClose() {
|
||||||
|
|||||||
Reference in new issue
Block a user