Skip to content

Commit 9dd1e14

Browse files
committed
Added stale page detection on mouse move
1 parent a3a5af4 commit 9dd1e14

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

control/templates/control/controlPanelNew.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,8 @@ <h3>Muon Veto</h3>
406406
svgStyle: null
407407
});
408408

409+
409410
function PageTimeoutCounter(){
410-
if(pageTimeoutTimer > 60){
411-
alert("Page has not updated for 60 seconds. You probably have a stale tab. Please refresh your browser.");
412-
return;
413-
}
414411
pageTimeoutTimer += 5;
415412
setTimeout(function(){ PageTimeoutCounter();}, 5000);
416413
};
@@ -635,7 +632,14 @@ <h3>Muon Veto</h3>
635632
}
636633

637634
$(function(){ //DOM Ready
638-
PageTimeoutCounter();
635+
PageTimeoutCounter();
636+
document.alertshown=false;
637+
$(document).mousemove(function() {
638+
if(pageTimeoutTimer > 60 && !document.alertshown){
639+
alert("Stale page detected. Please update your browser window to proceed.");
640+
document.alertshown=true;
641+
}
642+
});
639643
document.autoplay=false;
640644
// Save some info from template tags
641645
document.user = "{{ request.user.username }}";

0 commit comments

Comments
 (0)