diff options
author | alecpl <alec@alec.pl> | 2010-05-05 19:14:53 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-05-05 19:14:53 +0000 |
commit | 1f019c8e5886461eb1ab0c053d88527d45ccacde (patch) | |
tree | 4e03ee2795ce1ebdb1a3a56e494cb01cf19d6436 /program/js/editor.js | |
parent | c6427797b7b54716a8555fa5acef817a7ea3cdfc (diff) |
- Set focus to editor on reply in HTML mode (#1486632)
- Fix composing in HTML jumps cursor to body instead of recipients (#1486674)
Diffstat (limited to 'program/js/editor.js')
-rw-r--r-- | program/js/editor.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/program/js/editor.js b/program/js/editor.js index 1b1129ecc..34511ce0b 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -63,11 +63,18 @@ function rcmail_editor_init(skin_path, editor_lang, spellcheck, mode) // react to real individual tinyMCE editor init function rcmail_editor_callback(editor) { - var input_from = rcube_find_object('_from'); - if (input_from && input_from.type=='select-one') - rcmail.change_identity(input_from); + 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 on tinyMCE editor |