compose: Fix new topic button behavior in home view.

This commit is contained in:
Tim Abbott 2017-03-21 17:13:18 -07:00
parent 34a9e1ae11
commit 82ec083066
1 changed files with 8 additions and 8 deletions

View File

@ -212,12 +212,17 @@ function same_recipient_as_before(msg_type, opts) {
function show_box_for_msg_type(msg_type, opts) {
var focus_area;
// Set focus to "Topic" when narrowed to a stream+topic and "New topic" button clicked.
if (msg_type === 'stream' && opts.stream && ! opts.subject) {
focus_area = 'subject';
} else if ((msg_type === 'stream' && opts.stream)
|| (msg_type === 'private' && opts.private_message_recipient)) {
if (opts.trigger === "new topic button") {
focus_area = 'subject';
} else {
focus_area = 'new_message_content';
}
}
if (msg_type === 'stream') {
show_box('stream', $("#" + (focus_area || 'stream')), opts);
@ -266,13 +271,8 @@ exports.start = function (msg_type, opts) {
is_composing_message = msg_type;
// 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);