1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

rework notifications flyout

This commit is contained in:
Luke Pulverenti 2015-05-31 17:07:44 -04:00
parent 9b6cd65b9d
commit 8e0dc6d8e4
11 changed files with 115 additions and 189 deletions

View file

@ -1,16 +1,15 @@
(function ($, document, Notifications) {
$(document).on("pageinit", "#notificationsPage", function () {
$(document).on("pageshowready", "#notificationsPage", function () {
// If there is no user logged in there can be no notifications
if (!Dashboard.getCurrentUserId()) return;
var elem = $(".notificationsList");
var btn = $(".btnMarkReadContainer");
var startIndex = 0;
var limit = 10;
Notifications.showNotificationsList(startIndex, limit, elem, btn);
Notifications.showNotificationsList(startIndex, limit, elem);
elem.on("click", ".btnPreviousPage", function (e) {
@ -20,7 +19,7 @@
if (startIndex < 0) startIndex = 0;
Notifications.showNotificationsList(startIndex, limit, elem, btn);
Notifications.showNotificationsList(startIndex, limit, elem);
})
.on("click", ".btnNextPage", function (e) {
@ -29,25 +28,11 @@
startIndex = startIndex + limit;
Notifications.showNotificationsList(startIndex, limit, elem, btn);
Notifications.showNotificationsList(startIndex, limit, elem);
});
$(".readOnlyContent").on("click", ".btnMarkRead", function () {
var ids = $(".notificationsList div").map(function () {
return this.getAttribute('data-notificationid');
}).get();
Notifications.markNotificationsRead(ids, function () {
Notifications.showNotificationsList(startIndex, limit, elem, btn);
});
});
Notifications.markNotificationsRead([]);
});