diff --git a/client/js/renderPreview.js b/client/js/renderPreview.js index de1b1301..083122e2 100644 --- a/client/js/renderPreview.js +++ b/client/js/renderPreview.js @@ -92,7 +92,10 @@ function appendPreview(preview, msg, template) { $(window).on("resize", debounce(showMoreIfNeeded, 150)); window.requestAnimationFrame(showMoreIfNeeded); - previewContent.on("showMoreIfNeeded", showMoreIfNeeded); + previewContent.on( + "showMoreIfNeeded", + () => window.requestAnimationFrame(showMoreIfNeeded) + ); if (activeChannelId === channelId) { container.trigger("keepToBottom"); diff --git a/client/js/utils.js b/client/js/utils.js index a7660d8f..5433247b 100644 --- a/client/js/utils.js +++ b/client/js/utils.js @@ -145,5 +145,6 @@ function requestIdleCallback(callback, timeout) { // Force handling preview display function togglePreviewMoreButtonsIfNeeded() { - window.requestAnimationFrame(() => $(window).trigger("resize")); + $("#chat .chan.active .toggle-content.toggle-type-link.show") + .trigger("showMoreIfNeeded"); }