summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/editor.js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-05 07:49:00 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-05 07:49:00 +0000
commit0a67d5863827ac26f0d4e9ef6f53fce1c06f48ee (patch)
treef8d7aa4095c00fa303535cea50f90720e72f4dde /roundcubemail/program/js/editor.js
parentb2c8ca5f6a9121ee7c8f89f4f7220c07196672c8 (diff)
- Improve r4038: we can use keypress on FF and Opera, here we've got repetition
- Small code cleanup git-svn-id: https://svn.roundcube.net/trunk@4039 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/editor.js')
-rw-r--r--roundcubemail/program/js/editor.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/roundcubemail/program/js/editor.js b/roundcubemail/program/js/editor.js
index d3e587b75..1896e850f 100644
--- a/roundcubemail/program/js/editor.js
+++ b/roundcubemail/program/js/editor.js
@@ -64,15 +64,18 @@ function rcmail_editor_init(skin_path, editor_lang, spellcheck, mode)
// react to real individual tinyMCE editor init
function rcmail_editor_callback()
{
- var elem = rcube_find_object('_from');
- if (elem && elem.type=='select-one') {
+ var elem = rcube_find_object('_from'),
+ fe = rcmail.env.compose_focus_elem;
+
+ if (elem && elem.type == 'select-one') {
rcmail.change_identity(elem);
// Focus previously focused element
- if (rcmail.env.compose_focus_elem && rcmail.env.compose_focus_elem.id != rcmail.env.composebody)
- rcmail.env.compose_focus_elem.focus();
+ if (fe && fe.id != rcmail.env.composebody)
+ fe.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);
+ rcmail_editor_tabindex(fe && fe.id == rcmail.env.composebody);
// Trigger resize (needed for proper editor resizing in some browsers using default skin)
$(window).resize();
}