Merge pull request #1040 from thelounge/focusin-reset-notifications

Reset notification markers on document focus
This commit is contained in:
Jérémie Astori 2017-04-15 13:20:23 -04:00 committed by GitHub
commit 5bc1be1f39

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();