mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Notifications list updates
Conflicts: MediaBrowser.WebDashboard/dashboard-ui/notificationlist.html
This commit is contained in:
parent
03a78537a6
commit
1c0b553e3d
2 changed files with 19 additions and 8 deletions
|
@ -81,12 +81,14 @@
|
|||
|
||||
});
|
||||
|
||||
self.isFlyout = true;
|
||||
|
||||
var startIndex = 0;
|
||||
var limit = 4;
|
||||
var elem = $('.notificationsFlyoutlist');
|
||||
var markReadButton = $('.btnMarkReadContainer');
|
||||
|
||||
refreshNotifications(startIndex, limit, elem, markReadButton);
|
||||
refreshNotifications(startIndex, limit, elem, markReadButton, false);
|
||||
};
|
||||
|
||||
self.markNotificationsRead = function(ids, callback) {
|
||||
|
@ -103,23 +105,23 @@
|
|||
|
||||
};
|
||||
|
||||
self.showNotificationsList = function(startIndex, limit, elem, btn) {
|
||||
self.showNotificationsList = function (startIndex, limit, elem, btn) {
|
||||
|
||||
refreshNotifications(startIndex, limit, elem, btn);
|
||||
refreshNotifications(startIndex, limit, elem, btn, true);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
function refreshNotifications(startIndex, limit, elem, btn) {
|
||||
function refreshNotifications(startIndex, limit, elem, btn, showPaging) {
|
||||
|
||||
ApiClient.getNotifications(Dashboard.getCurrentUserId(), { StartIndex: startIndex, Limit: limit }).done(function (result) {
|
||||
|
||||
listUnreadNotifications(result.Notifications, result.TotalRecordCount, startIndex, limit, elem, btn);
|
||||
listUnreadNotifications(result.Notifications, result.TotalRecordCount, startIndex, limit, elem, btn, showPaging);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function listUnreadNotifications(list, totalRecordCount, startIndex, limit, elem, btn) {
|
||||
function listUnreadNotifications(list, totalRecordCount, startIndex, limit, elem, btn, showPaging) {
|
||||
|
||||
if (!totalRecordCount) {
|
||||
elem.html('<p style="padding:.5em 1em;">No unread notifications.</p>');
|
||||
|
@ -141,7 +143,7 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
if (totalRecordCount > limit) {
|
||||
if (totalRecordCount > limit && showPaging === true) {
|
||||
|
||||
var query = { StartIndex: startIndex, Limit: limit };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue