From 17a23c60b80474f053997f90d05a94acb8561604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 5 Mar 2014 11:54:55 +0100 Subject: [PATCH] [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 --- addons/web/static/lib/cleditor/jquery.cleditor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/web/static/lib/cleditor/jquery.cleditor.js b/addons/web/static/lib/cleditor/jquery.cleditor.js index 1208839ad14..c9e5deff36c 100644 --- a/addons/web/static/lib/cleditor/jquery.cleditor.js +++ b/addons/web/static/lib/cleditor/jquery.cleditor.js @@ -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);