mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2025-12-23 22:37:53 -05:00
Fix: With "bfcache," always refresh the page without analyzing the content height. (skin.js)
Because in addition to Firefox, the problem occurs on some Linux (Chromium) and Android (Chrome) devices.
This commit is contained in:
@@ -2088,22 +2088,22 @@ function initPageGeneral() {
|
||||
}, 200);
|
||||
|
||||
// https://web.dev/articles/bfcache Firefox has a peculiar behavior of caching the previous page.
|
||||
// The problem also occurs on some Linux (Chromium) and Android (Chrome) devices.
|
||||
window.addEventListener('pageshow', (event) => {
|
||||
if (event.persisted) {
|
||||
// Do any checks and updates to the page
|
||||
if (mainContentJ[0].clientHeight < 1) {
|
||||
window.location.reload( true );
|
||||
}
|
||||
window.location.reload( true );
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('beforeunload', function addListenerGlobalBeforeunload(event) {
|
||||
function addListenerGlobalBeforeunload(event) {
|
||||
//window.removeEventListener('beforeunload', addListenerGlobalBeforeunload);
|
||||
//event.preventDefault();
|
||||
if (navbar_type == 'left') {
|
||||
closeMbExtruder(updateCookie = true);
|
||||
}
|
||||
|
||||
if (mainContentJ) {
|
||||
if (mainContent) {
|
||||
if (mainContentJ.css('display') == 'flex') {
|
||||
// If flex-grow is set to a value > 0 then "height" will be ignored!
|
||||
mainContentJ.css({flex: "0 1 auto"});
|
||||
@@ -2112,14 +2112,13 @@ function initPageGeneral() {
|
||||
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 = '';
|
||||
});
|
||||
}
|
||||
window.addEventListener('beforeunload', addListenerGlobalBeforeunload);
|
||||
|
||||
document.querySelectorAll('[id ^= "controlMute"]').forEach(function(el) {
|
||||
el.addEventListener("click", function clickControlMute(event) {
|
||||
|
||||
Reference in New Issue
Block a user