1
0
Fork 0
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:
Tim Hobbs 2014-05-27 17:23:00 -07:00
parent 03a78537a6
commit 1c0b553e3d
2 changed files with 19 additions and 8 deletions

View file

@ -84,7 +84,16 @@
} }
.btnMarkReadContainer, .btnNotificationListContainer { .btnMarkReadContainer, .btnNotificationListContainer {
padding: .5em; padding: 0 .5em;
}
.notificationsList {
border-bottom: 1px solid #ccc;
}
.notificationsList .flyoutNotification {
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
} }
.imgNotification, .imgNotificationInner { .imgNotification, .imgNotificationInner {

View file

@ -81,12 +81,14 @@
}); });
self.isFlyout = true;
var startIndex = 0; var startIndex = 0;
var limit = 4; var limit = 4;
var elem = $('.notificationsFlyoutlist'); var elem = $('.notificationsFlyoutlist');
var markReadButton = $('.btnMarkReadContainer'); var markReadButton = $('.btnMarkReadContainer');
refreshNotifications(startIndex, limit, elem, markReadButton); refreshNotifications(startIndex, limit, elem, markReadButton, false);
}; };
self.markNotificationsRead = function(ids, callback) { self.markNotificationsRead = function(ids, callback) {
@ -105,21 +107,21 @@
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) { 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) { if (!totalRecordCount) {
elem.html('<p style="padding:.5em 1em;">No unread notifications.</p>'); elem.html('<p style="padding:.5em 1em;">No unread notifications.</p>');
@ -141,7 +143,7 @@
var html = ''; var html = '';
if (totalRecordCount > limit) { if (totalRecordCount > limit && showPaging === true) {
var query = { StartIndex: startIndex, Limit: limit }; var query = { StartIndex: startIndex, Limit: limit };