diff --git a/web/src/pm_list.js b/web/src/pm_list.js index 3b367c9bd8..2a0fcf78ab 100644 --- a/web/src/pm_list.js +++ b/web/src/pm_list.js @@ -31,7 +31,7 @@ export function set_count(count) { ui_util.update_unread_count_in_dom(get_private_messages_section_header(), count); } -function close() { +export function close() { private_messages_collapsed = true; $("#toggle_private_messages_section_icon").removeClass("fa-caret-down"); $("#toggle_private_messages_section_icon").addClass("fa-caret-right"); @@ -100,7 +100,13 @@ export function update_private_messages() { } export function expand() { + // Only one thing can be zoomed at a time. + if (topic_zoom.is_zoomed_in()) { + topic_zoom.zoom_out(); + } + private_messages_collapsed = false; + $("#toggle_private_messages_section_icon").addClass("fa-caret-down"); $("#toggle_private_messages_section_icon").removeClass("fa-caret-right"); update_private_messages(); diff --git a/web/src/topic_zoom.js b/web/src/topic_zoom.js index f87d333265..7f46d0f642 100644 --- a/web/src/topic_zoom.js +++ b/web/src/topic_zoom.js @@ -1,5 +1,6 @@ import $ from "jquery"; +import * as pm_list from "./pm_list"; import * as popovers from "./popovers"; import * as stream_list from "./stream_list"; import * as topic_list from "./topic_list"; @@ -15,6 +16,7 @@ function zoom_in() { const stream_id = topic_list.active_stream_id(); popovers.hide_all_except_sidebars(); + pm_list.close(); topic_list.zoom_in(); stream_list.zoom_in_topics({ stream_id,