From d5ec571b8da57c53f3361afcb0a4a4eaa2804613 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 28 Aug 2013 13:39:05 +0200 Subject: [PATCH] [FIX] using the correct event turns out to work better than using the wrong one The event for an editor being ready is instanceReady not loaded, turns out there's no need for big comments whining about things not working when using the right one. bzr revid: xmo@openerp.com-20130828113905-sp2nby6hbnae8jfp --- addons/website/static/src/js/website.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 22976b1de53..54d1cd69904 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -342,20 +342,15 @@ var node = this; var $node = $(node); var editor = CKEDITOR.inline(this, self._config()); - editor.on('loaded', function () { - // CKEditor *still* performs DOM alterations after - // loaded has fired => defer observation to ensure no - // more initialization-related DOM alteration - setTimeout(function () { - observer.observe(node, { - childList: true, - attributes: true, - characterData: true, - subtree: true - }); - }, 0); + editor.on('instanceReady', function () { + observer.observe(node, { + childList: true, + attributes: true, + characterData: true, + subtree: true + }); }); - $node.one('content_changed', function (e) { + $node.one('content_changed', function () { $node.addClass('oe_dirty'); self.trigger('change'); });