diff --git a/static/js/pm_list.js b/static/js/pm_list.js index 277406a302..58372c1f08 100644 --- a/static/js/pm_list.js +++ b/static/js/pm_list.js @@ -76,7 +76,6 @@ function zoom_in() { exports.close = function () { private_messages_open = false; zoomed_in = false; - $("ul.filters li").removeClass('active-filter active-sub-filter'); remove_expanded_private_messages(); }; @@ -166,6 +165,7 @@ exports.update_private_messages = function () { exports.rebuild_recent(""); } else if (is_pm_filter) { exports.rebuild_recent(""); + $("#global_filters li[data-name='private']").addClass('active-filter'); } }; diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 9fb336dd8c..0a5ffe0b2d 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -391,6 +391,10 @@ exports.refresh_pinned_or_unpinned_stream = function (sub) { exports.update_streams_sidebar(); }; +function deselect_top_left_corner_items() { + $("ul.filters li").removeClass('active-filter active-sub-filter'); +} + $(function () { // TODO, Eventually topic_list won't be a big singleton, // and we can create more component-based click handlers for @@ -403,6 +407,7 @@ $(function () { pm_list.set_click_handlers(); $(document).on('narrow_activated.zulip', function (event) { + deselect_top_left_corner_items(); reset_to_unnarrowed(narrow.stream() === zoomed_stream); // TODO: handle confused filters like "in:all stream:foo" @@ -439,6 +444,7 @@ $(function () { }); $(document).on('narrow_deactivated.zulip', function () { + deselect_top_left_corner_items(); reset_to_unnarrowed(); pm_list.close(); $("#global_filters li[data-name='home']").addClass('active-filter');