diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-07-31 09:48:46 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-07-31 09:48:46 +0000 |
| commit | a881c61ad69c8c16ab787958689ea73326f68281 (patch) | |
| tree | 5aaa1d42bf8a0ee93443b5731a74cd493ae1368a /roundcubemail/program/js/editor.js | |
| parent | 91ffdc759436ca359975560eb9e42e1c6d9b5d6e (diff) | |
Disable active spell check in tinyMCE before switching to plaintext mode (#1486870) + focus message field after mode switch
git-svn-id: https://svn.roundcube.net/trunk@3846 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/editor.js')
| -rw-r--r-- | roundcubemail/program/js/editor.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/roundcubemail/program/js/editor.js b/roundcubemail/program/js/editor.js index fd128cb8f..c81ef2581 100644 --- a/roundcubemail/program/js/editor.js +++ b/roundcubemail/program/js/editor.js @@ -67,19 +67,12 @@ function rcmail_editor_callback(editor) var editor, elem = rcube_find_object('_from'); if (elem && elem.type=='select-one') rcmail.change_identity(elem); - // set tabIndex - rcmail_editor_tabindex(); - // set focus to element that was focused before - if (elem = rcmail.env.compose_focus_elem) { - if (elem.id == rcmail.env.composebody && (editor = tinyMCE.get(rcmail.env.composebody))) - editor.getWin().focus(); - else - elem.focus(); - } + // set tabIndex and set focus to element that was focused before + rcmail_editor_tabindex(rcmail.env.compose_focus_elem && rcmail.env.compose_focus_elem.id == rcmail.env.composebody); } // set tabIndex on tinyMCE editor -function rcmail_editor_tabindex() +function rcmail_editor_tabindex(focus) { if (rcmail.env.task == 'mail') { var editor = tinyMCE.get(rcmail.env.composebody); @@ -88,6 +81,8 @@ function rcmail_editor_tabindex() var node = editor.getContentAreaContainer().childNodes[0]; if (textarea && node) node.tabIndex = textarea.tabIndex; + if (focus) + editor.getWin().focus(); } } } @@ -106,14 +101,16 @@ function rcmail_toggle_editor(select, textAreaId, flagElement) if (ishtml) { // #1486593 - setTimeout("rcmail_editor_tabindex();", 500); + setTimeout("rcmail_editor_tabindex(true);", 500); if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '1'; } else { if (!res && select.tagName == 'SELECT') - select.value = 'html'; + select.value = 'html'; if (flagElement && (flag = rcube_find_object(flagElement))) flag.value = '0'; + + rcube_find_object(rcmail.env.composebody).focus(); } } |
