Wait for tinyMCE editor to initialize when loading the notes view (#3293)
This commit is contained in:
parent
f75cc4757d
commit
79af219093
2 changed files with 14 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Add table
Reference in a new issue