[FIX] website: catch exception on destroy of ckeditor to allow the modifications to be saved anyway

This commit is contained in:
Jeremy Kersten 2014-07-24 18:12:32 +02:00
parent 335e4a8cc3
commit 89e8626ab0
1 changed files with 7 additions and 1 deletions

View File

@ -546,7 +546,13 @@
observer.disconnect();
var editor = this.rte.editor;
var root = editor.element.$;
editor.destroy();
try {
editor.destroy();
}
catch(err) {
// Hack to avoid the lost of all changes because ckeditor fails in destroy
console.log("Error in editor.destroy() : " + err.toString() + "\n " + err.stack);
}
// FIXME: select editables then filter by dirty?
var defs = this.rte.fetch_editables(root)
.filter('.oe_dirty')