asdasd
This commit is contained in:
@@ -1 +1 @@
|
|||||||
1.1.38
|
1.1.39
|
||||||
@@ -835,7 +835,12 @@
|
|||||||
}
|
}
|
||||||
const styleEl = document.getElementById('bridge-rte-modal-style') || document.createElement('style');
|
const styleEl = document.getElementById('bridge-rte-modal-style') || document.createElement('style');
|
||||||
styleEl.id = 'bridge-rte-modal-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) {
|
if (!styleEl.parentNode) {
|
||||||
document.head.appendChild(styleEl);
|
document.head.appendChild(styleEl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -480,6 +480,25 @@
|
|||||||
try {
|
try {
|
||||||
const modelType = model && model.get ? model.get('type') : undefined;
|
const modelType = model && model.get ? model.get('type') : undefined;
|
||||||
const selectedEl = model && model.view && model.view.el;
|
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 viewOuter = selectedEl ? String(selectedEl.outerHTML || '') : '';
|
||||||
const modelContent = model && model.get ? String(model.get('content') || '') : '';
|
const modelContent = model && model.get ? String(model.get('content') || '') : '';
|
||||||
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';
|
const editorHtml = editor && typeof editor.getHtml === 'function' ? String(editor.getHtml() || '') : '';
|
||||||
|
|||||||
Reference in New Issue
Block a user