mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
Be intelligent about which input box is highlighted in compose.start()
(imported from commit 37268601d569fdb510415ebfae594804817c0e3a)
This commit is contained in:
@@ -18,14 +18,26 @@ exports.start = function (msg_type, opts) {
|
|||||||
|
|
||||||
$('#sidebar a[href="#home"]').tab('show');
|
$('#sidebar a[href="#home"]').tab('show');
|
||||||
|
|
||||||
if (msg_type === 'stream') {
|
if (msg_type !== 'stream') {
|
||||||
exports.show('stream', $("#stream"));
|
// TODO: Just to make sure that compose.composing() output is
|
||||||
} else {
|
// consistent. We really should just standardize our
|
||||||
// for making compose.composing() output consistent
|
// terminology
|
||||||
msg_type = "huddle";
|
msg_type = "huddle";
|
||||||
|
|
||||||
exports.show('personal', $("#huddle_recipient"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var focus_area;
|
||||||
|
if (opts.stream && ! opts.subject) {
|
||||||
|
focus_area = 'subject';
|
||||||
|
} else if (opts.stream || opts.huddle_recipient) {
|
||||||
|
focus_area = 'new_message_content';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg_type === 'stream') {
|
||||||
|
exports.show('stream', $("#" + focus_area || 'stream'));
|
||||||
|
} else {
|
||||||
|
exports.show('personal', $("#" + focus_area || 'huddle_recipients'));
|
||||||
|
}
|
||||||
|
|
||||||
hotkeys.set_compose();
|
hotkeys.set_compose();
|
||||||
is_composing_message = msg_type;
|
is_composing_message = msg_type;
|
||||||
$(document).trigger($.Event('compose_started.zephyr', opts));
|
$(document).trigger($.Event('compose_started.zephyr', opts));
|
||||||
|
|||||||
Reference in New Issue
Block a user