Avoid opening compose box for topic sidebar clicks.

We don't want to auto-open the compose box for topic
sidebar clicks, because we want to convenience folks
reading messages, not writing messages, since on
stream narrows, people tend to do much more reading
than writing.  (Also, opening the compose box explicitly
is super easy.)

The part of this change that affects behavior is that
we remove the call to compose_actions.start('stream').

Then the simplification is that we replace the checks
to narrowed_by_reply() and !narrowed_to_topic() with
a single call to narrowed_by_pm_reply().

Fixes #3886.
This commit is contained in:
Steve Howell
2017-04-16 05:34:53 -07:00
committed by Tim Abbott
parent af887822b5
commit bdca28a14b

View File

@@ -375,10 +375,8 @@ exports.activate = function (raw_operators, opts) {
$('#search_query').val(Filter.unparse(operators)); $('#search_query').val(Filter.unparse(operators));
search.update_button_visibility(); search.update_button_visibility();
if (!had_message_content && opts.trigger === 'sidebar' && exports.narrowed_by_reply()) { if (!had_message_content) {
if (exports.narrowed_to_topic()) { if (exports.narrowed_by_pm_reply() && (opts.trigger === 'sidebar')) {
compose_actions.start('stream');
} else {
compose_actions.start('private'); compose_actions.start('private');
} }
} }