hide some elements, notifications zone, bug fixes

This commit is contained in:
Ivan
2024-02-01 01:36:06 +03:00
parent 24d47644d4
commit 6175c86816
15 changed files with 180 additions and 62 deletions

View File

@@ -36,6 +36,44 @@ $(document).ready(function () {
});
});
function toggleNotifications() {
if ($("#dropdownNotifications").hasClass("is-visible")) {
event.preventDefault();
$("#dropdownNotifications").removeClass("is-visible");
$("#dropdownNotifications").css("display", "none");
} else {
event.preventDefault();
$("#dropdownNotifications").css("display", "inline-flex");
setTimeout(function () {
$("#dropdownNotifications").addClass("is-visible");
}, 100);
}
}
$(document).on("click", function (event) {
if ($(event.target).closest("#notificationsIcon").length) {
return;
} else {
if (!$(event.target).closest(".dropdown-account").length) {
$("#dropdownNotifications").removeClass("is-visible");
setTimeout(function () {
$("#dropdownNotifications").css("display", "none");
}, 200);
}
}
});
$(document).ready(function () {
$(document).keydown(function (e) {
if (e.key === "Escape" || e.key === "Esc") {
$("#dropdownNotifications").removeClass("is-visible");
setTimeout(function () {
$("#dropdownNotifications").css("display", "none");
}, 200);
}
});
});
function setTheme(theme) {
document.documentElement.setAttribute("data-theme", theme);