From 1f019c8e5886461eb1ab0c053d88527d45ccacde Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 5 May 2010 19:14:53 +0000 Subject: - Set focus to editor on reply in HTML mode (#1486632) - Fix composing in HTML jumps cursor to body instead of recipients (#1486674) --- program/js/editor.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'program/js/editor.js') 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 -- cgit v1.2.3