mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
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:
@@ -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 = '';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user