[IMP] [MONKEY] Re-apply changes introduced at version 3328.

Original commit by chm.

[FIX] cleditor: When the DOM is modify, the event resize try to call refresh and refresh has not DOM available. Correction : If the DOM as no prent, don't call refresh.

bzr revid: tde@openerp.com-20140305105455-1ewix4pm9m5ob1bm
This commit is contained in:
Thibault Delavallée 2014-03-05 11:54:55 +01:00
parent bff34f4014
commit 17a23c60b8
1 changed files with 6 additions and 2 deletions

View File

@ -306,8 +306,12 @@
// Bind the window resize event when the width or height is auto or %
if (/auto|%/.test("" + options.width + options.height))
$(window).bind('resize.cleditor', function () { refresh(editor); });
$(window).bind('resize.cleditor', function () {
// CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor
if(editor.$main.parent().parent().size()) {
refresh(editor);
}
});
// Create the iframe and resize the controls
refresh(editor);