summaryrefslogtreecommitdiff
path: root/plugins/kolab_notes
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-12 13:17:11 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-12 13:17:46 (GMT)
commit79af21909398aa60c572c45e0fc783fbb091c92c (patch)
treed77f69855b784cbc3e665e22b4dd8021f67f2c14 /plugins/kolab_notes
parentf75cc4757d3759da158cf60c32e0a9a9217592a7 (diff)
downloadroundcubemail-plugins-kolab-79af21909398aa60c572c45e0fc783fbb091c92c.tar.gz
Wait for tinyMCE editor to initialize when loading the notes view (#3293)
Diffstat (limited to 'plugins/kolab_notes')
-rw-r--r--plugins/kolab_notes/notes.js14
-rw-r--r--plugins/kolab_notes/skins/larry/templates/dialogview.html2
2 files changed, 14 insertions, 2 deletions
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){