Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

resize: Hide popover on width change on mobile devices.

Aman Agrawala23cc709e8f3
diff --git a/static/js/resize.js b/static/js/resize.js
index b5b72363143..f4ba1ef3848 100644
--- a/static/js/resize.js
+++ b/static/js/resize.js
@@ -253,18 +253,18 @@ let _old_width = $(window).width();
export function handler() {
const new_width = $(window).width();
- if (new_width !== _old_width) {
- _old_width = new_width;
- condense.clear_message_content_height_cache();
- }
-
- // On mobile web, we want to avoid hiding a popover here,
+ // On mobile web, we want to avoid hiding a popover here on height change,
// especially if this resize was triggered by a virtual keyboard
// popping up when the user opened that very popover.
const mobile = util.is_mobile();
- if (!mobile) {
+ if (!mobile || new_width !== _old_width) {
popovers.hide_all();
}
+
+ if (new_width !== _old_width) {
+ _old_width = new_width;
+ condense.clear_message_content_height_cache();
+ }
resize_page_components();
// Re-compute and display/remove [More] links to messages