asdasd
This commit is contained in:
@@ -32,6 +32,7 @@ async function ensureAuthenticated() {
|
||||
}
|
||||
|
||||
function initAppFeatures() {
|
||||
installGlobalModalGuards();
|
||||
initTabs();
|
||||
initLists();
|
||||
initCreate();
|
||||
@@ -43,6 +44,30 @@ function initAppFeatures() {
|
||||
ensureFloatingLogout({ redirect: '/login.php' });
|
||||
}
|
||||
|
||||
function installGlobalModalGuards() {
|
||||
if (window.__modalGuardsInstalled) return;
|
||||
window.__modalGuardsInstalled = true;
|
||||
|
||||
document.addEventListener('click', (evt) => {
|
||||
const dlg = evt.target && evt.target.tagName === 'DIALOG'
|
||||
? evt.target
|
||||
: (evt.target && evt.target.closest ? evt.target.closest('dialog') : null);
|
||||
if (!dlg) return;
|
||||
if (evt.target === dlg) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}, true);
|
||||
|
||||
document.addEventListener('cancel', (evt) => {
|
||||
const dlg = evt.target;
|
||||
if (dlg && dlg.tagName === 'DIALOG') {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
// Sync-Nachrichten aus dem Editor-Iframe (unverändert, aber mit credentials)
|
||||
async function handleEditorMessages(ev) {
|
||||
const msg = ev.data || {};
|
||||
|
||||
Reference in New Issue
Block a user