Merge pull request #4053 from IgorA100/patch-127

Stop monitors when closing montage page
pull/4054/head
Isaac Connor 2024-05-29 09:04:58 -04:00 committed by GitHub
commit db45047a3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -1103,6 +1103,15 @@ function changeMonitorStatusPositon() {
// Kick everything off
$j(window).on('load', () => initPage());
//Stop monitors when closing page
document.onvisibilitychange = () => {
if (document.visibilityState === "hidden") {
for (let i = 0, length = monitorData.length; i < length; i++) {
monitors[i].kill();
}
}
};
/*
window.onbeforeunload = function(e) {
console.log('unload');