compose: Focus on topic when narrowed to a stream+topic.

When narrowed to a stream+topic and clicking the "new topic" button,
focus in on topic and the text remains selected.
Fixes #3888.
This commit is contained in:
Raghav Jajodia
2017-03-05 19:17:00 +05:30
committed by Tim Abbott
parent b8341280e8
commit 21f0339cfc
2 changed files with 8 additions and 3 deletions

View File

@@ -264,8 +264,13 @@ exports.start = function (msg_type, opts) {
is_composing_message = msg_type;
// Show either stream/topic fields or "You and" field.
show_box_for_msg_type(msg_type, opts);
// Set focus to "Topic" when narrowed to a stream+topic and "New topic" button clicked.
if (opts.trigger === "new topic button") {
show_box('stream', $("#subject"), opts);
} else {
// Show either stream/topic fields or "You and" field.
show_box_for_msg_type(msg_type, opts);
}
compose_fade.start_compose(msg_type);