mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
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:
committed by
Tim Abbott
parent
b8341280e8
commit
21f0339cfc
@@ -336,7 +336,7 @@ $(function () {
|
|||||||
|
|
||||||
|
|
||||||
$('.compose_stream_button').click(function () {
|
$('.compose_stream_button').click(function () {
|
||||||
compose.start('stream');
|
compose.start('stream', {trigger: 'new topic button'});
|
||||||
});
|
});
|
||||||
$('.compose_private_button').click(function () {
|
$('.compose_private_button').click(function () {
|
||||||
compose.start('private');
|
compose.start('private');
|
||||||
|
|||||||
@@ -264,8 +264,13 @@ exports.start = function (msg_type, opts) {
|
|||||||
|
|
||||||
is_composing_message = msg_type;
|
is_composing_message = msg_type;
|
||||||
|
|
||||||
// Show either stream/topic fields or "You and" field.
|
// Set focus to "Topic" when narrowed to a stream+topic and "New topic" button clicked.
|
||||||
show_box_for_msg_type(msg_type, opts);
|
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);
|
compose_fade.start_compose(msg_type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user