plugins/kolab_notes

Thomas Brüderli bruederli at kolabsys.com
Tue Aug 12 15:17:52 CEST 2014


 plugins/kolab_notes/notes.js                              |   14 +++++++++++++-
 plugins/kolab_notes/skins/larry/templates/dialogview.html |    2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 79af21909398aa60c572c45e0fc783fbb091c92c
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Aug 12 15:17:11 2014 +0200

    Wait for tinyMCE editor to initialize when loading the notes view (#3293)

diff --git a/plugins/kolab_notes/notes.js b/plugins/kolab_notes/notes.js
index 7179a5a..aaafe3d 100644
--- a/plugins/kolab_notes/notes.js
+++ b/plugins/kolab_notes/notes.js
@@ -764,7 +764,7 @@ function rcube_kolab_notes_ui(settings)
     /**
      *
      */
-    function render_note(data)
+    function render_note(data, retry)
     {
         rcmail.set_busy(false, 'loading', ui_loading);
 
@@ -853,6 +853,18 @@ function rcube_kolab_notes_ui(settings)
         }
 
         var node, editor = tinyMCE.get('notecontent'), is_html = false;
+        retry = retry || 0;
+
+        // sometimes the editor instance is not ready yet (FF only)...
+        if (!readonly && !editor && $('#notecontent').length && retry < 5) {
+          // ... give it some more time
+          setTimeout(function() {
+              $(rcmail.gui_objects.noteseditform).show();
+              render_note(data, retry+1);
+          }, 200);
+          return;
+        }
+
         if (!readonly && editor) {
             $(rcmail.gui_objects.notesdetailview).hide();
             $(rcmail.gui_objects.noteseditform).show();
diff --git a/plugins/kolab_notes/skins/larry/templates/dialogview.html b/plugins/kolab_notes/skins/larry/templates/dialogview.html
index bc1f7f9..781c413 100644
--- a/plugins/kolab_notes/skins/larry/templates/dialogview.html
+++ b/plugins/kolab_notes/skins/larry/templates/dialogview.html
@@ -51,7 +51,7 @@ $(document).ready(function(e){
         // fixes issue when toolbar is not ready yet and content
         // area height is set to 0, wait and try again later...
         if (h < 0)
-            setTimeout(function() { layout_view(); }, 1000);
+            setTimeout(function() { layout_view(); }, 100);
     }
 
     $(window).resize(function(e){




More information about the commits mailing list