mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
39 lines
1019 B
JavaScript
39 lines
1019 B
JavaScript
(function ($, document, Notifications) {
|
|
|
|
$(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 startIndex = 0;
|
|
var limit = 10;
|
|
|
|
Notifications.showNotificationsList(startIndex, limit, elem);
|
|
|
|
elem.on("click", ".btnPreviousPage", function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
startIndex = startIndex - limit;
|
|
|
|
if (startIndex < 0) startIndex = 0;
|
|
|
|
Notifications.showNotificationsList(startIndex, limit, elem);
|
|
|
|
})
|
|
.on("click", ".btnNextPage", function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
startIndex = startIndex + limit;
|
|
|
|
Notifications.showNotificationsList(startIndex, limit, elem);
|
|
|
|
});
|
|
|
|
Notifications.markNotificationsRead([]);
|
|
|
|
});
|
|
|
|
})(jQuery, document, Notifications); |