asdasd
This commit is contained in:
@@ -743,7 +743,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const setupPlainTextPreserver = (editor) => {
|
const setupPlainTextPreserver = (editor) => {
|
||||||
const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link')));
|
const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link') || model.is('textnode')));
|
||||||
const lastContent = new Map();
|
const lastContent = new Map();
|
||||||
const normalizeHtml = (value) => {
|
const normalizeHtml = (value) => {
|
||||||
return String(value || '')
|
return String(value || '')
|
||||||
@@ -752,8 +752,9 @@
|
|||||||
.trim();
|
.trim();
|
||||||
};
|
};
|
||||||
const snapshotContent = (model) => {
|
const snapshotContent = (model) => {
|
||||||
|
const rawContent = model && model.get ? model.get('content') : '';
|
||||||
const el = model.view && model.view.el;
|
const el = model.view && model.view.el;
|
||||||
const html = String(model.get ? (model.get('content') || '') : '').trim();
|
const html = String(rawContent || '').trim();
|
||||||
const inner = el && el.innerHTML ? String(el.innerHTML).trim() : '';
|
const inner = el && el.innerHTML ? String(el.innerHTML).trim() : '';
|
||||||
const text = el && el.textContent ? String(el.textContent).trim() : '';
|
const text = el && el.textContent ? String(el.textContent).trim() : '';
|
||||||
const composite = html || inner || text;
|
const composite = html || inner || text;
|
||||||
@@ -788,6 +789,10 @@
|
|||||||
editor.on('component:update', (model) => restoreIfEmpty(model));
|
editor.on('component:update', (model) => restoreIfEmpty(model));
|
||||||
editor.on('component:input', (model) => restoreIfEmpty(model));
|
editor.on('component:input', (model) => restoreIfEmpty(model));
|
||||||
editor.on('component:add', (model) => rememberIfPresent(model));
|
editor.on('component:add', (model) => rememberIfPresent(model));
|
||||||
|
editor.on('rte:disable', (model) => {
|
||||||
|
const target = model || (editor.getSelected && editor.getSelected());
|
||||||
|
rememberIfPresent(target);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const setupTableBuilder = (editor) => {
|
const setupTableBuilder = (editor) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user