Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
more/less: Fix bug where messages rapidly condense and uncondense.
evykassirer8d0fa236c80a
diff --git a/web/src/condense.js b/web/src/condense.jsindex 4db57b4e097..f5267aa0987 100644--- a/web/src/condense.js+++ b/web/src/condense.js@@ -162,8 +162,8 @@ function get_message_height(elem, message_id) {return _message_content_height_cache.get(message_id);}- // shown to be ~2.5x faster than Node.getBoundingClientRect().- const height = elem.offsetHeight;+ const height = $(elem).find(".message_content")[0].scrollHeight;+if (!recent_topics_util.is_visible()) {_message_content_height_cache.set(message_id, height);}diff --git a/web/src/message_lists.js b/web/src/message_lists.jsindex cbd0b4dffb2..9963d0967cf 100644--- a/web/src/message_lists.js+++ b/web/src/message_lists.js@@ -1,3 +1,5 @@+import $ from "jquery";+import {Filter} from "./filter";import * as message_list from "./message_list";import * as recent_topics_util from "./recent_topics_util";@@ -18,6 +20,10 @@ export function all_rendered_message_lists() {return rendered_message_lists;}+export function all_current_message_rows() {+ return $(`#${current.table_name}.message_table .message_row`);+}+export function update_recipient_bar_background_color() {for (const msg_list of all_rendered_message_lists()) {msg_list.view.update_recipient_bar_background_color();diff --git a/web/src/resize.js b/web/src/resize.jsindex c6b568505ba..f60a941e836 100644--- a/web/src/resize.js+++ b/web/src/resize.js@@ -178,7 +178,7 @@ export function handler() {update_recent_topics_filters_height();// Re-compute and display/remove [More] links to messages- condense.condense_and_collapse($(".message_table .message_row"));+ condense.condense_and_collapse(message_lists.all_current_message_rows());// This function might run onReady (if we're in a narrow window),// but before we've loaded in the messages; in that case, don't