Reset notification markers on document focus

Fixes #837
This commit is contained in:
Pavel Djundik 2017-04-15 18:40:19 +03:00
parent 8627bbb713
commit d093a7f4c2

View File

@ -1595,14 +1595,11 @@ $(function() {
$("#viewport .lt").toggleClass("notified", newState);
}
document.addEventListener(
"visibilitychange",
function() {
if (sidebar.find(".highlight").length === 0) {
toggleNotificationMarkers(false);
}
$(document).on("visibilitychange focus", () => {
if (sidebar.find(".highlight").length === 0) {
toggleNotificationMarkers(false);
}
);
});
// Only start opening socket.io connection after all events have been registered
socket.open();