[IMP] [MONKEY] Re-apply changes introduced at version 3328.
authorThibault Delavallée <tde@openerp.com>
Wed, 5 Mar 2014 10:54:55 +0000 (11:54 +0100)
committerThibault Delavallée <tde@openerp.com>
Wed, 5 Mar 2014 10:54:55 +0000 (11:54 +0100)
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

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