gosora/themes/nox/public/misc.js
Azareal 436c53f653 The user box on Nox should be highlighted now when there's a new alert.
Removed some notes as they're not really needed now that I've refactored the alert builder.
2018-10-06 16:35:53 +10:00

24 lines
611 B
JavaScript

"use strict";
(() => {
addInitHook("after_update_alert_list", () => {
if(alertCount==0) {
$(".alerts").html("No new alerts");
$(".user_box").removeClass("has_alerts");
} else {
$(".alerts").html(alertCount + " new alerts");
$(".user_box").addClass("has_alerts");
}
})
})();
$(document).ready(() => {
$(".alerts").click((event) => {
event.stopPropagation();
var alerts = $(".menu_alerts")[0];
if($(alerts).hasClass("selectedAlert")) return;
if(!conn) loadAlerts(alerts);
alerts.className += " selectedAlert";
document.getElementById("back").className += " alertActive"
});
});