- Set focus to editor on reply in HTML mode (#1486632)

- Fix composing in HTML jumps cursor to body instead of recipients (#1486674)
release-0.6
alecpl 15 years ago
parent c6427797b7
commit 1f019c8e58

@ -1,6 +1,8 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Set focus to editor on reply in HTML mode (#1486632)
- Fix composing in HTML jumps cursor to body instead of recipients (#1486674)
- Allow columns order change per user - drag&drop (#1485795) - Allow columns order change per user - drag&drop (#1485795)
- Add References header in read receipt (#1486681) - Add References header in read receipt (#1486681)
- Fix database constraint violation when opening a message (#1486696) - Fix database constraint violation when opening a message (#1486696)

@ -2621,9 +2621,11 @@ function rcube_webmail()
input_to.focus(); input_to.focus();
else if (input_subject.val() == '') else if (input_subject.val() == '')
input_subject.focus(); input_subject.focus();
else if (input_message && !html_mode) else if (input_message)
input_message.focus(); input_message.focus();
this.env.compose_focus_elem = document.activeElement;
// get summary of all field values // get summary of all field values
this.compose_field_hash(true); this.compose_field_hash(true);
@ -2789,12 +2791,12 @@ function rcube_webmail()
if (!show_sig) if (!show_sig)
show_sig = this.env.show_sig; show_sig = this.env.show_sig;
var id = obj.options[obj.selectedIndex].value; var sig, cursor_pos, p = -1,
var input_message = $("[name='_message']"); id = obj.options[obj.selectedIndex].value,
var message = input_message.val(); input_message = $("[name='_message']"),
var is_html = ($("input[name='_is_html']").val() == '1'); message = input_message.val(),
var sig_separator = this.env.sig_above && (this.env.compose_mode == 'reply' || this.env.compose_mode == 'forward') ? '---' : '-- '; is_html = ($("input[name='_is_html']").val() == '1'),
var sig, cursor_pos, p = -1; sig_separator = this.env.sig_above && (this.env.compose_mode == 'reply' || this.env.compose_mode == 'forward') ? '---' : '-- ';
if (!this.env.identity) if (!this.env.identity)
this.env.identity = id this.env.identity = id
@ -2855,20 +2857,20 @@ function rcube_webmail()
this.set_caret_pos(input_message.get(0), cursor_pos); this.set_caret_pos(input_message.get(0), cursor_pos);
} }
else if (show_sig && this.env.signatures) { // html else if (show_sig && this.env.signatures) { // html
var editor = tinyMCE.get(this.env.composebody); var editor = tinyMCE.get(this.env.composebody),
var sigElem = editor.dom.get('_rc_sig'); sigElem = editor.dom.get('_rc_sig');
// Append the signature as a div within the body // Append the signature as a div within the body
if (!sigElem) { if (!sigElem) {
var body = editor.getBody(); var body = editor.getBody(),
var doc = editor.getDoc(); doc = editor.getDoc();
sigElem = doc.createElement('div'); sigElem = doc.createElement('div');
sigElem.setAttribute('id', '_rc_sig'); sigElem.setAttribute('id', '_rc_sig');
if (this.env.sig_above) { if (this.env.sig_above) {
// if no existing sig and top posting then insert at caret pos // if no existing sig and top posting then insert at caret pos
editor.getWin().focus(); // correct focus in IE editor.getWin().focus(); // correct focus in IE & Chrome
var node = editor.selection.getNode(); var node = editor.selection.getNode();
if (node.nodeName == 'BODY') { if (node.nodeName == 'BODY') {

@ -63,11 +63,18 @@ function rcmail_editor_init(skin_path, editor_lang, spellcheck, mode)
// react to real individual tinyMCE editor init // react to real individual tinyMCE editor init
function rcmail_editor_callback(editor) function rcmail_editor_callback(editor)
{ {
var input_from = rcube_find_object('_from'); var editor, elem = rcube_find_object('_from');
if (input_from && input_from.type=='select-one') if (elem && elem.type=='select-one')
rcmail.change_identity(input_from); rcmail.change_identity(elem);
// set tabIndex // set tabIndex
rcmail_editor_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 // set tabIndex on tinyMCE editor

Loading…
Cancel
Save