From 67cf3bbd27eeac4e6ebb395e99dd48e2ed0715af Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Wed, 28 Jan 2026 01:05:41 +0100 Subject: [PATCH] asdasd --- config/current.ver | 2 +- public/assets/js/bridge/rte-editor.js | 7 ++++++- public/editor/bridge-core.js | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/config/current.ver b/config/current.ver index c99926d..f2f5ed4 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.1.38 \ No newline at end of file +1.1.39 \ No newline at end of file diff --git a/public/assets/js/bridge/rte-editor.js b/public/assets/js/bridge/rte-editor.js index 968968f..bcb7720 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -835,7 +835,12 @@ } const styleEl = document.getElementById('bridge-rte-modal-style') || document.createElement('style'); styleEl.id = 'bridge-rte-modal-style'; - styleEl.textContent = '.bridge-rte-modal .gjs-mdl-btn-close{display:none!important;}'; + styleEl.textContent = [ + '.bridge-rte-modal .gjs-mdl-btn-close{display:none!important;}', + '.bridge-rte-modal .gjs-mdl-dialog{max-height:90vh;overflow:hidden;}', + '.bridge-rte-container{max-height:80vh;}', + '.bridge-rte-content{max-height:55vh;overflow:auto;}', + ].join(''); if (!styleEl.parentNode) { document.head.appendChild(styleEl); } diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 7e1eadf..682e867 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -480,6 +480,25 @@ try { const modelType = model && model.get ? model.get('type') : undefined; const selectedEl = model && model.view && model.view.el; + const normalizeViewHtmlForModel = (html) => { + return String(html || '') + .replace(/]*>/gi, '
') + .replace(/\sdata-gjs-type="[^"]*"/gi, '') + .replace(/\sdraggable="[^"]*"/gi, '') + .replace(/\scontenteditable="[^"]*"/gi, '') + .trim(); + }; + if (label === 'DESELECT' && modelType === 'text' && selectedEl) { + try { + const viewHtml = normalizeViewHtmlForModel(selectedEl.innerHTML || ''); + if (viewHtml && model && model.set) { + if (model.components) { + try { model.components(viewHtml); } catch {} + } + model.set('content', viewHtml); + } + } catch {} + } const viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : ''; const modelContent = model && model.get ? String(model.get('content') || '') : ''; const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';