Jul 24 - Update Rich-text editor to enhance table editor 3
This commit is contained in:
@@ -168,7 +168,19 @@
|
||||
}
|
||||
|
||||
var quill = new Quill(editorEl, { theme: 'snow', modules: modules });
|
||||
if (ta.value.trim()) quill.clipboard.dangerouslyPasteHTML(ta.value);
|
||||
|
||||
// Load existing body. quill-table-better warns that setContents /
|
||||
// dangerouslyPasteHTML make tables render blank, so convert the saved HTML
|
||||
// to a delta and apply it with updateContents instead.
|
||||
if (ta.value.trim()) {
|
||||
if (hasTables) {
|
||||
var delta = quill.clipboard.convert({ html: ta.value });
|
||||
quill.updateContents(delta, Quill.sources.USER);
|
||||
quill.setSelection(delta.length(), Quill.sources.SILENT);
|
||||
} else {
|
||||
quill.clipboard.dangerouslyPasteHTML(ta.value);
|
||||
}
|
||||
}
|
||||
|
||||
var csrf = document.querySelector('meta[name="csrf-token"]').content;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user