asdasd
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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(/<br\b[^>]*>/gi, '<br>')
|
||||
.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() || '') : '';
|
||||
|
||||
Reference in New Issue
Block a user