Only use animate when ZM_WEB_ANIMATIONS is true. Also add .length to j(#btn-collapse because jquery always returns a truthy thing.

This commit is contained in:
Isaac Connor
2025-12-05 14:13:15 -05:00
parent d68c41b8ac
commit 82be257741

View File

@@ -2108,12 +2108,15 @@ function initPageGeneral() {
// If flex-grow is set to a value > 0 then "height" will be ignored!
mainContentJ.css({flex: "0 1 auto"});
}
mainContentJ.animate({height: 0}, 300, function rollupBeforeunloadPage() {
const btnCollapse = $j('body').find('#btn-collapse');
if (btnCollapse) btnCollapse.css({display: "none"});
if (typeof ZM_WEB_ANIMATIONS === 'undefined' || !ZM_WEB_ANIMATIONS) {
mainContentJ.css({display: "none"});
});
} else {
mainContentJ.animate({height: 0}, 300, function rollupBeforeunloadPage() {
const btnCollapse = $j('body').find('#btn-collapse');
if (btnCollapse.length) btnCollapse.css({display: "none"});
mainContentJ.css({display: "none"});
});
}
}
//event.returnValue = '';
});