Placeholder 2

This commit is contained in:
2026-01-31 01:11:08 +01:00
parent cd8d37688f
commit 32eeeaf27a
2 changed files with 25 additions and 9 deletions

View File

@@ -1 +1 @@
1.1.68 1.1.69

View File

@@ -521,13 +521,32 @@ const refreshPlaceholderComponent = (component) => {
} }
}); });
const closeModalSafe = () => {
if (!modal) return;
const modalWindow = (modal.el && modal.el.ownerDocument && modal.el.ownerDocument.defaultView) || window;
if (modalWindow && modalWindow.B && typeof modalWindow.B.allowModalCloseOnce === 'function') {
modalWindow.B.allowModalCloseOnce();
}
if (typeof modal.__bridgeOriginalClose === 'function') {
modal.__bridgeOriginalClose();
return;
}
if (typeof modal.close === 'function') {
modal.close();
return;
}
if (modal.getModel && typeof modal.getModel === 'function') {
const mdl = modal.getModel();
if (mdl && typeof mdl.set === 'function') {
mdl.set('open', false);
}
}
};
cancelBtn.addEventListener('click', (e) => { cancelBtn.addEventListener('click', (e) => {
e.preventDefault(); e.preventDefault();
fireCancel('cancel-button'); fireCancel('cancel-button');
if (window.B && typeof window.B.allowModalCloseOnce === 'function') { closeModalSafe();
window.B.allowModalCloseOnce();
}
modal.close();
}); });
const applyPayload = (payload) => { const applyPayload = (payload) => {
@@ -603,10 +622,7 @@ const refreshPlaceholderComponent = (component) => {
} }
} }
didSave = true; didSave = true;
if (window.B && typeof window.B.allowModalCloseOnce === 'function') { closeModalSafe();
window.B.allowModalCloseOnce();
}
modal.close();
}); });
toggleSections(); toggleSections();