Merge pull request #4053 from IgorA100/patch-127
Stop monitors when closing montage pagepull/4054/head
commit
db45047a3f
|
@ -1103,6 +1103,15 @@ function changeMonitorStatusPositon() {
|
||||||
// Kick everything off
|
// Kick everything off
|
||||||
$j(window).on('load', () => initPage());
|
$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) {
|
window.onbeforeunload = function(e) {
|
||||||
console.log('unload');
|
console.log('unload');
|
||||||
|
|
Loading…
Reference in New Issue