Trigger the correct event directly instead of resize when opening/closing a menu

This commit is contained in:
Jérémie Astori 2018-04-07 23:20:14 -04:00
parent 53a2101de3
commit 1ccdeb015c
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
2 changed files with 6 additions and 2 deletions

View File

@ -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");

View File

@ -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");
}