diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php b/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php index 4ec20cfc3..45cb99b95 100644 --- a/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php +++ b/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php @@ -411,25 +411,19 @@ $('body').on('click','a,.ca_href', function(e) { var nchanPaused = false; var blurTimer = false; + $(window).focus(function() { nchanFocusStart(); }); // Stop nchan on loss of focus - $(window).blur(function() { blurTimer = setTimeout(function(){ nchanFocusStop(); },30000); }); - document.addEventListener("visibilitychange", (event) => { - - if (document.hidden) { - nchanFocusStop(); - } - if (document.hidden) { nchanFocusStop(); } else { @@ -445,7 +439,6 @@ document.addEventListener("visibilitychange", (event) => { nchanFocusStart(); } - }); function nchanFocusStart() { @@ -486,4 +479,5 @@ function nchanFocusStop(banner=true) { } } } +