mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Added notification list page
Totally basic but gets the job done
This commit is contained in:
parent
8cadabcbe5
commit
6d764f3e5f
4 changed files with 188 additions and 61 deletions
51
dashboard-ui/scripts/notificationlist.js
Normal file
51
dashboard-ui/scripts/notificationlist.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
(function ($, document, Notifications) {
|
||||
|
||||
$(document).on("pagebeforeshow", ".page", function () {
|
||||
|
||||
var elem = $(".notificationsList");
|
||||
var btn = $(".btnMarkReadContainer");
|
||||
var startIndex = 0;
|
||||
var limit = 10;
|
||||
|
||||
Notifications.showNotificationsList(startIndex, limit, elem, btn);
|
||||
|
||||
elem.on("click", ".btnPreviousPage", function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
startIndex = startIndex - limit;
|
||||
|
||||
if (startIndex < 0) startIndex = 0;
|
||||
|
||||
Notifications.showNotificationsList(startIndex, limit, elem, btn);
|
||||
|
||||
})
|
||||
.on("click", ".btnNextPage", function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
startIndex = startIndex + limit;
|
||||
|
||||
Notifications.showNotificationsList(startIndex, limit, elem, btn);
|
||||
|
||||
});
|
||||
|
||||
$(".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);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document, Notifications);
|
Loading…
Add table
Add a link
Reference in a new issue