From 6465a92a38bb42dae3f669e9f2e4f570b6dd5d95 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 25 Sep 2010 06:34:54 -0400
Subject: [PATCH] - Support action in form of "task/action" in goto_url()

---
 program/js/editor.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/program/js/editor.js b/program/js/editor.js
index 938aa82..4555582 100644
--- a/program/js/editor.js
+++ b/program/js/editor.js
@@ -62,13 +62,14 @@
 }
 
 // react to real individual tinyMCE editor init
-function rcmail_editor_callback(editor)
+function rcmail_editor_callback()
 {
-  var editor, elem = rcube_find_object('_from');
+  var elem = rcube_find_object('_from');
   if (elem && elem.type=='select-one') {
     rcmail.change_identity(elem);
     // Focus previously focused element
-    rcmail.env.compose_focus_elem.focus();
+    if (rcmail.env.compose_focus_elem.id != rcmail.env.composebody)
+      rcmail.env.compose_focus_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);
@@ -116,6 +117,7 @@
     if (flagElement && (flag = rcube_find_object(flagElement)))
       flag.value = '0';
 
-    rcube_find_object(rcmail.env.composebody).focus();
+    if (rcmail.env.composebody)
+      rcube_find_object(rcmail.env.composebody).focus();
   }
 }

--
Gitblit v1.9.1