mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
jQuery reduction
This commit is contained in:
parent
438755e048
commit
54333d6d2f
2 changed files with 20 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
(function ($, document, Dashboard) {
|
||||
define([], function () {
|
||||
|
||||
function notifications() {
|
||||
|
||||
|
@ -39,10 +39,17 @@
|
|||
|
||||
promise.then(function (summary) {
|
||||
|
||||
var item = $('.btnNotificationsInner').removeClass('levelNormal').removeClass('levelWarning').removeClass('levelError').html(summary.UnreadCount);
|
||||
var btnNotificationsInner = document.querySelector('.btnNotificationsInner');
|
||||
if (btnNotificationsInner) {
|
||||
|
||||
if (summary.UnreadCount) {
|
||||
item.addClass('level' + summary.MaxUnreadNotificationLevel);
|
||||
btnNotificationsInner.classList.remove('levelNormal');
|
||||
btnNotificationsInner.classList.remove('levelWarning');
|
||||
btnNotificationsInner.classList.remove('levelError');
|
||||
btnNotificationsInner.innerHTML = summary.UnreadCount;
|
||||
|
||||
if (summary.UnreadCount) {
|
||||
btnNotificationsInner.classList.add('level' + summary.MaxUnreadNotificationLevel);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -205,4 +212,4 @@
|
|||
|
||||
});
|
||||
|
||||
})(jQuery, document, Dashboard);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue