From 644b904ce35f2afff083d1b00c8cd928329b19d8 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sat, 17 Jan 2026 03:47:56 +0100 Subject: [PATCH] clos view code --- public/editor/bridge-core.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index c34e943..dde5ed4 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -33,6 +33,13 @@ window.__bridgeModalAllowClose = false; document.addEventListener('click', (evt) => { + const closeHit = evt.target && evt.target.closest + ? evt.target.closest('.gjs-mdl-btn-close,[data-bridge-modal-close="1"]') + : null; + if (closeHit) { + window.__bridgeModalAllowClose = true; + setTimeout(() => { window.__bridgeModalAllowClose = false; }, 0); + } const container = evt.target && evt.target.closest ? evt.target.closest('.gjs-mdl-container') : null; @@ -43,11 +50,6 @@ evt.stopPropagation(); return; } - const closeBtn = evt.target.closest && evt.target.closest('.gjs-mdl-btn-close,[data-bridge-modal-close="1"]'); - if (closeBtn) { - window.__bridgeModalAllowClose = true; - setTimeout(() => { window.__bridgeModalAllowClose = false; }, 0); - } } }, true);