From bdca28a14b20de0cc8ac6a4fb85267b51ea4045a Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 16 Apr 2017 05:34:53 -0700 Subject: [PATCH] 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. --- static/js/narrow.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/js/narrow.js b/static/js/narrow.js index 36f6cf7fe1..5b8d85e47c 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -375,10 +375,8 @@ exports.activate = function (raw_operators, opts) { $('#search_query').val(Filter.unparse(operators)); search.update_button_visibility(); - if (!had_message_content && opts.trigger === 'sidebar' && exports.narrowed_by_reply()) { - if (exports.narrowed_to_topic()) { - compose_actions.start('stream'); - } else { + if (!had_message_content) { + if (exports.narrowed_by_pm_reply() && (opts.trigger === 'sidebar')) { compose_actions.start('private'); } }