Skip to content

Commit

Permalink
Merge pull request #1040 from thelounge/focusin-reset-notifications
Browse files Browse the repository at this point in the history
Reset notification markers on document focus
  • Loading branch information
astorije committed Apr 15, 2017
2 parents 8627bbb + d093a7f commit 5bc1be1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/js/lounge.js
Expand Up @@ -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();
Expand Down

0 comments on commit 5bc1be1

Please sign in to comment.