[FIX] website: catch exception on destroy of ckeditor to allow the modifications...
authorJeremy Kersten <jke@odoo.com>
Thu, 24 Jul 2014 16:12:32 +0000 (18:12 +0200)
committerJeremy Kersten <jke@odoo.com>
Thu, 24 Jul 2014 16:12:32 +0000 (18:12 +0200)
addons/website/static/src/js/website.editor.js

index 93d7542..a05c226 100644 (file)
             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')