diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-03-31 07:37:43 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-03-31 07:37:43 +0000 |
| commit | 3507f4b5ac55184ce77f72d4ecf5432d29845966 (patch) | |
| tree | 7296348b94ff47ec062a08b2071ec9e756663892 | |
| parent | b9956709264498a31dd57c4627e19b0e4f6787f0 (diff) | |
- Fix js error when switching editor mode (#1486593)
git-svn-id: https://svn.roundcube.net/trunk@3447 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/js/editor.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/roundcubemail/program/js/editor.js b/roundcubemail/program/js/editor.js index b1ef31bde..2c86d8ec7 100644 --- a/roundcubemail/program/js/editor.js +++ b/roundcubemail/program/js/editor.js @@ -55,7 +55,7 @@ function rcmail_editor_init(skin_path, editor_lang, spellcheck, mode) gecko_spellcheck : true, relative_urls : false, remove_script_host : false, - rc_client: rcmail, + rc_client : rcmail, oninit : 'rcmail_editor_callback' }); } @@ -75,10 +75,12 @@ function rcmail_editor_tabindex() { if (rcmail.env.task == 'mail') { var editor = tinyMCE.get(rcmail.env.composebody); - var textarea = editor.getElement(); - var node = editor.getContentAreaContainer().childNodes[0]; - if (textarea && node) - node.tabIndex = textarea.tabIndex; + if (editor) { + var textarea = editor.getElement(); + var node = editor.getContentAreaContainer().childNodes[0]; + if (textarea && node) + node.tabIndex = textarea.tabIndex; + } } } @@ -98,8 +100,9 @@ function rcmail_toggle_editor(select, textAreaId, flagElement) rcmail.display_spellcheck_controls(false); rcmail.plain2html(composeElement.value, textAreaId); - tinyMCE.execCommand('mceAddControl', true, textAreaId); - rcmail_editor_tabindex(); + tinyMCE.execCommand('mceToggleEditor', false, textAreaId); + // #1486593 + setTimeout("rcmail_editor_tabindex();", 500); if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '1'; } @@ -118,7 +121,7 @@ function rcmail_toggle_editor(select, textAreaId, flagElement) rcmail.html2plain(existingHtml, textAreaId); } - tinyMCE.execCommand('mceRemoveControl', true, textAreaId); + tinyMCE.execCommand('mceToggleEditor', false, textAreaId); rcmail.display_spellcheck_controls(true); if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '0'; |
