Updating notifications side bar - UI

revert-dabc3590
dilanua 8 years ago
parent 1efbc15cdb
commit 13aedbc6c6

@ -85,11 +85,7 @@ var updateNotificationCountOnSuccess = function (data, textStatus, jqXHR) {
if (jqXHR.status == 200 && data) { if (jqXHR.status == 200 && data) {
var responsePayload = JSON.parse(data); var responsePayload = JSON.parse(data);
var newNotificationsCount = responsePayload["count"]; var newNotificationsCount = responsePayload["count"];
if (newNotificationsCount > 5) { if (newNotificationsCount > 0) {
$(notificationBubble).html("5 <sup>+</sup> &nbsp;NEW");
$(notificationBubble).removeClass("hidden");
$(notificationSpacer).removeClass("hidden");
} else if (newNotificationsCount <= 5 && newNotificationsCount > 0) {
$(notificationBubble).html(newNotificationsCount + " NEW"); $(notificationBubble).html(newNotificationsCount + " NEW");
$(notificationBubble).removeClass("hidden"); $(notificationBubble).removeClass("hidden");
$(notificationSpacer).removeClass("hidden"); $(notificationSpacer).removeClass("hidden");
@ -111,7 +107,7 @@ function loadNewNotificationsOnSideViewPanel() {
if ($("#right-sidebar").attr("is-authorized") == "false") { if ($("#right-sidebar").attr("is-authorized") == "false") {
$("#notification-bubble-wrapper").remove(); $("#notification-bubble-wrapper").remove();
} else { } else {
var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=6&status=NEW";
invokerUtil.get(serviceURL, updateNotificationCountOnSuccess, updateNotificationCountOnError); invokerUtil.get(serviceURL, updateNotificationCountOnSuccess, updateNotificationCountOnError);
loadNewNotifications(); loadNewNotifications();
} }
@ -126,7 +122,7 @@ function loadNewNotifications() {
var currentUser = notifications.data("currentUser"); var currentUser = notifications.data("currentUser");
$.template("notification-listing", notifications.attr("src"), function (template) { $.template("notification-listing", notifications.attr("src"), function (template) {
var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=6&status=NEW";
invokerUtil.get( invokerUtil.get(
serviceURL, serviceURL,
// on success // on success

@ -5,9 +5,9 @@
<li class="message" data-type="selectable" > <li class="message" data-type="selectable" >
<h4> <h4>
<i class="icon fw fw-mobile text-muted"></i> <i class="icon fw fw-mobile text-muted"></i>
<a href="../device/{{deviceType}}?id={{deviceIdentifier}}" <a href="device/{{deviceType}}?id={{deviceIdentifier}}"
data-id="{{operationId}}" data-id="{{operationId}}"
data-url="../device/{{deviceType}}?id={{deviceIdentifier}}" data-url="device/{{deviceType}}?id={{deviceIdentifier}}"
class="new-notification text-capitalize" data-click-event="remove-form"> class="new-notification text-capitalize" data-click-event="remove-form">
Failure on {{deviceType}} {{deviceName}} Failure on {{deviceType}} {{deviceName}}
</a> </a>

Loading…
Cancel
Save