Christophe Matthieu (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-fix-cleditor-chm into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-fix-cleditor-chm/+merge/131919

[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.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-fix-cleditor-chm/+merge/131919
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-fix-cleditor-chm.
=== modified file 'addons/web/static/lib/cleditor/jquery.cleditor.js'
--- addons/web/static/lib/cleditor/jquery.cleditor.js	2012-06-15 13:32:37 +0000
+++ addons/web/static/lib/cleditor/jquery.cleditor.js	2012-10-29 14:27:28 +0000
@@ -275,7 +275,6 @@
             button.popupContent, button.popupHover);
         
       }
-
     });
 
     // Add the main div to the DOM and append the textarea
@@ -295,7 +294,12 @@
 
     // Bind the window resize event when the width or height is auto or %
     if (/auto|%/.test("" + options.width + options.height))
-      $(window).resize(function() {refresh(editor);});
+      $(window).resize(function() {
+        // 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);
@@ -562,10 +566,9 @@
   //==================
   // Private Functions
   //==================
-
+
   // checksum - returns a checksum using the Adler-32 method
-  function checksum(text)
-  {
+  function checksum(text) {
     var a = 1, b = 0;
     for (var index = 0; index < text.length; ++index) {
       a = (a + text.charCodeAt(index)) % 65521;
@@ -799,7 +802,7 @@
       options = editor.options;
 
     // Remove the old iframe
-    if (editor.$frame) 
+    if (editor.$frame)
       editor.$frame.remove();
 
     // Create a new iframe

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to