Make Private Messages work better when zoomed in.

Some of the work here was done Tomasz Kolek.

When we click on "more conversations" in "Private Messages,"
we call it being "zoomed in."  Before this change, when
new PMs arrived, we would rebuild the list and zoom out
again.  Now we track the zoomed_in state with a variable.
Also, if you are zoomed in and switch from one PM narrow
to another, we also keep you zoomed in.

This fix also removes some extraneous/redundant code.

Fixes: #2561
This commit is contained in:
Steve Howell
2016-12-16 16:14:07 -08:00
committed by Tim Abbott
parent 561562da3d
commit a96fdd18b1
4 changed files with 36 additions and 13 deletions

View File

@@ -205,8 +205,6 @@ function reset_to_unnarrowed(narrowed_within_same_stream) {
} else {
topic_list.remove_expanded_topics();
}
pm_list.reset_to_unnarrowed();
}
exports.set_in_home_view = function (stream, in_home) {
@@ -414,6 +412,8 @@ $(function () {
var op_pm = event.filter.operands('pm-with');
if ((op_is.length !== 0 && _.contains(op_is, "private")) || op_pm.length !== 0) {
pm_list.expand(op_pm);
} else {
pm_list.close();
}
var op_stream = event.filter.operands('stream');
@@ -430,6 +430,7 @@ $(function () {
$(document).on('narrow_deactivated.zulip', function () {
reset_to_unnarrowed();
pm_list.close();
$("#global_filters li[data-name='home']").addClass('active-filter');
});