diff --git a/dashboard-ui/css/notifications.css b/dashboard-ui/css/notifications.css index 5c96a2315e..93cc1e9f67 100644 --- a/dashboard-ui/css/notifications.css +++ b/dashboard-ui/css/notifications.css @@ -83,7 +83,7 @@ background-color: #ECEEF4; } -.btnMarkReadContainer { +.btnMarkReadContainer, .btnNotificationListContainer { padding: .5em; } diff --git a/dashboard-ui/notificationlist.html b/dashboard-ui/notificationlist.html new file mode 100644 index 0000000000..fa78fdf8a8 --- /dev/null +++ b/dashboard-ui/notificationlist.html @@ -0,0 +1,34 @@ + + +
+Loading...'; + html += 'Close'; - html += '
'; + html += ' '; - html += ''; - html += 'Loading...'; - $(document.body).append(html); + html += '
'; - $('.notificationsFlyout').popup({ positionTo: context }).trigger('create').popup("open").on("popupafterclose", function () { + html += ''; - $(this).off("popupafterclose").remove(); + html += ''; - }).on('click', '.btnMarkRead', function () { + html += 'No unread notifications.
'); - $('.btnMarkReadContainer').hide(); + btn.hide(); return; } - if (notifications.filter(function (n) { + Notifications.total = totalRecordCount; + + if (list.filter(function (n) { return !n.IsRead; }).length) { - $('.btnMarkReadContainer').show(); + btn.show(); } else { - $('.btnMarkReadContainer').hide(); + btn.hide(); } - var html = ''; - for (var i = 0, length = notifications.length; i < length; i++) { + if (totalRecordCount > limit) { - var notification = notifications[i]; + var query = { StartIndex: startIndex, Limit: limit }; + + html += LibraryBrowser.getPagingHtml(query, totalRecordCount, false, limit, false); + } + + for (var i = 0, length = list.length; i < length; i++) { + + var notification = list[i]; html += getNotificationHtml(notification); @@ -169,15 +209,17 @@ } + window.Notifications = new notifications(); + $(Dashboard).on('interiorheaderrendered', function (e, header, user) { if (!user || $('.notificationsButton', header).length) { return; } - $('0').insertAfter($('.btnCurrentUser', header)).on('click', showNotificationsFlyout); + $('0').insertAfter($('.btnCurrentUser', header)).on('click', Notifications.showNotificationsFlyout); - updateNotificationCount(); + Notifications.updateNotificationCount(); }); $(ApiClient).on("websocketmessage", function (e, msg) { @@ -185,12 +227,12 @@ if (msg.MessageType === "NotificationUpdated" || msg.MessageType === "NotificationAdded" || msg.MessageType === "NotificationsMarkedRead") { - getNotificationsSummaryPromise = null; + Notifications.getNotificationsSummaryPromise = null; - updateNotificationCount(); + Notifications.updateNotificationCount(); } }); -})(jQuery, document, Dashboard); \ No newline at end of file +})(jQuery, document, Dashboard, LibraryBrowser); \ No newline at end of file