From a8a20bdddd5d938532db153dc4e36f5d9d57af32 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 13 May 2022 11:01:38 -0400 Subject: [PATCH] Use kill instead of stop when nav button clicked. Comment out onbeforeunload, it isn't working as expected or documented --- web/skins/classic/views/js/montage.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/skins/classic/views/js/montage.js b/web/skins/classic/views/js/montage.js index ec818158c..0873c25e8 100644 --- a/web/skins/classic/views/js/montage.js +++ b/web/skins/classic/views/js/montage.js @@ -234,9 +234,8 @@ function initPage() { // If you click on the navigation links, shut down streaming so the browser can process it document.querySelectorAll('#main-header-nav a').forEach(function(el) { el.onclick = function() { - console.log("Stopping monitors"); for (var i = 0, length = monitors.length; i < length; i++) { - monitors[i].stop(); + monitors[i].kill(); } }; }); @@ -260,8 +259,10 @@ function handleClick(evt) { // Kick everything off $j(document).ready(initPage); +/* window.onbeforeunload = function (e) { - event.preventDefault(); + console.log('unload'); + //event.preventDefault(); for (let i = 0, length = monitorData.length; i < length; i++) { monitors[i].kill(); } @@ -269,9 +270,10 @@ window.onbeforeunload = function (e) { // For IE and Firefox if (e) { - e.returnValue = false; + e.returnValue = undefined; } // For Safari - return false; + return undefined; }; +*/