Trigger the correct event directly instead of resize when opening/closing a menu
This commit is contained in:
parent
53a2101de3
commit
1ccdeb015c
@ -92,7 +92,10 @@ function appendPreview(preview, msg, template) {
|
|||||||
|
|
||||||
$(window).on("resize", debounce(showMoreIfNeeded, 150));
|
$(window).on("resize", debounce(showMoreIfNeeded, 150));
|
||||||
window.requestAnimationFrame(showMoreIfNeeded);
|
window.requestAnimationFrame(showMoreIfNeeded);
|
||||||
previewContent.on("showMoreIfNeeded", showMoreIfNeeded);
|
previewContent.on(
|
||||||
|
"showMoreIfNeeded",
|
||||||
|
() => window.requestAnimationFrame(showMoreIfNeeded)
|
||||||
|
);
|
||||||
|
|
||||||
if (activeChannelId === channelId) {
|
if (activeChannelId === channelId) {
|
||||||
container.trigger("keepToBottom");
|
container.trigger("keepToBottom");
|
||||||
|
@ -145,5 +145,6 @@ function requestIdleCallback(callback, timeout) {
|
|||||||
|
|
||||||
// Force handling preview display
|
// Force handling preview display
|
||||||
function togglePreviewMoreButtonsIfNeeded() {
|
function togglePreviewMoreButtonsIfNeeded() {
|
||||||
window.requestAnimationFrame(() => $(window).trigger("resize"));
|
$("#chat .chan.active .toggle-content.toggle-type-link.show")
|
||||||
|
.trigger("showMoreIfNeeded");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user