[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
This commit is contained in:
Xavier Morel
2013-08-28 13:39:05 +02:00
parent 82bbba14de
commit d5ec571b8d
+8 -13
View File
@@ -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');
});