2018-09-20 10:45:33 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
(() => {
|
|
|
|
addInitHook("after_update_alert_list", () => {
|
|
|
|
if(alertCount==0) {
|
2018-10-06 06:35:53 +00:00
|
|
|
$(".alerts").html("No new alerts");
|
|
|
|
$(".user_box").removeClass("has_alerts");
|
2018-09-20 10:45:33 +00:00
|
|
|
} else {
|
2018-10-06 06:35:53 +00:00
|
|
|
$(".alerts").html(alertCount + " new alerts");
|
|
|
|
$(".user_box").addClass("has_alerts");
|
2018-09-20 10:45:33 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
})();
|
|
|
|
|
|
|
|
$(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"
|
|
|
|
});
|
|
|
|
});
|