Skip to content
Snippets Groups Projects
Commit 860733f6 authored by florian's avatar florian
Browse files

DRAFT: Only update source element in case of actual changes

parent d9984480
No related branches found
No related tags found
2 merge requests!68DOC: update CHANGELOG,!62FIX: Save WYSIWYG saving in source mode
Pipeline #17498 passed
......@@ -63,8 +63,14 @@ var ext_editmode_wysiwyg_text = function ($, logger, ClassicEditor, edit_mode, g
// Manually implement saving the data since edit mode is not
// a form to be submitted.
editor.model.document.on("change:data", (e) => {
// console.log(editor.getData());
// console.log(editor.sourceElement.value);
console.log(editor.getData() != editor.sourceElement.value);
if (editor.getData() != editor.sourceElement.value) {
console.log("Saving editor...");
editor.updateSourceElement();
}
});
// TODO(fspreck): Add an event listener to save also changes made in
// source mode. What event can we listen to? The following doesn't
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment