Skip to content

Commit

Permalink
Merge pull request thelounge#1040 from thelounge/focusin-reset-notifi…
Browse files Browse the repository at this point in the history
…cations

Reset notification markers on document focus
  • Loading branch information
astorije authored Apr 15, 2017
2 parents 9e54cac + ed9be39 commit f74bda7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/js/lounge.js
Original file line number Diff line number Diff line change
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 f74bda7

Please sign in to comment.