mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
Added highest severity calculation in NotifiationService
This commit is contained in:
parent
c0ff6de27b
commit
11264759ec
@ -1,4 +1,5 @@
|
||||
<span ng-show="notifications.length > 0" class="status block caution" ng-controller="NotificationIndicatorController">
|
||||
<span ng-show="notifications.length > 0" class="status block caution"
|
||||
ng-controller="NotificationIndicatorController">
|
||||
<span class="ui-symbol status-indicator">!</span>
|
||||
<span class="label">
|
||||
<a ng-click="showNotificationsList()">{{notifications.length}} Notifications</a>
|
||||
|
@ -87,6 +87,7 @@ define(
|
||||
function NotificationService($timeout, DEFAULT_AUTO_DISMISS, FORCE_AUTO_DISMISS) {
|
||||
this.notifications = [];
|
||||
this.$timeout = $timeout;
|
||||
this.highest ={ severity: MessageSeverity.INFO };
|
||||
this.DEFAULT_AUTO_DISMISS = DEFAULT_AUTO_DISMISS;
|
||||
this.FORCE_AUTO_DISMISS = FORCE_AUTO_DISMISS;
|
||||
|
||||
@ -198,12 +199,18 @@ define(
|
||||
NotificationService.prototype.selectNextNotification = function () {
|
||||
var notification,
|
||||
i=0;
|
||||
|
||||
this.highest.severity = MessageSeverity.INFO;
|
||||
|
||||
/*
|
||||
Loop through the notifications queue and find the first one self
|
||||
has not already been minimized (manually or otherwise).
|
||||
*/
|
||||
for (; i< this.notifications.length; i++) {
|
||||
notification = this.notifications[i];
|
||||
if (notification.severity > this.highest.severity){
|
||||
this.highest.severity = notification.severity;
|
||||
}
|
||||
|
||||
if (!notification.minimized
|
||||
&& notification!== this.active.notification) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user