summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-08-28 13:39:05 +0200
committerXavier Morel <xmo@openerp.com>2013-08-28 13:39:05 +0200
commitd5ec571b8da57c53f3361afcb0a4a4eaa2804613 (patch)
tree69361b21b62848892134ca17ca6e315858364e25 /addons/website/static/src
parent82bbba14de2248c94f80fe473f429b0fb31ac113 (diff)
[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
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/website.js21
1 files 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');
});