mirror of
https://github.com/nasa/openmct.git
synced 2025-03-23 04:25:27 +00:00
Added jsdoc and moved MessageController to dialogs from notifications
This commit is contained in:
parent
0053989de8
commit
109ae3323d
@ -43,6 +43,13 @@
|
||||
"key": "overlay",
|
||||
"templateUrl": "templates/overlay.html"
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "MessageController",
|
||||
"implementation": "MessageController.js",
|
||||
"depends": ["$scope"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -22,10 +22,23 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./MessageSeverity'],
|
||||
['../../notification/src/MessageSeverity'],
|
||||
function (MessageSeverity) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A controller for the message view which used to represent a
|
||||
* message to the user in the dialogs and notifications systems. The
|
||||
* message view (../res/templates/message.html) is included
|
||||
* from the blocking message dialog
|
||||
* (../res/templates/overlay-blocking-message.html),
|
||||
* and the message list (../res/templates/overlay-message-list.html)
|
||||
* shown from the notifications indicator
|
||||
* @param $scope
|
||||
* @constructor
|
||||
* @see DialogService#showBlockingMessage
|
||||
* @see NotificationService
|
||||
*/
|
||||
function MessageController($scope) {
|
||||
$scope.MessageSeverity = MessageSeverity;
|
||||
}
|
@ -25,10 +25,29 @@ define(
|
||||
['../../../notification/src/MessageSeverity'],
|
||||
function (MessageSeverity) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A controller for banner notifications. Banner notifications are a
|
||||
* non-blocking way of drawing the user's attention to an event such
|
||||
* as system errors, or the progress or successful completion of an
|
||||
* ongoing task. This controller provides scoped functions for
|
||||
* dismissing and 'maximizing' notifications. See {@link NotificationService}
|
||||
* for more details on Notifications.
|
||||
*
|
||||
* @param $scope
|
||||
* @param notificationService
|
||||
* @param dialogService
|
||||
* @constructor
|
||||
*/
|
||||
function BannerController($scope, notificationService, dialogService) {
|
||||
$scope.active = notificationService.active;
|
||||
$scope.MessageSeverity = MessageSeverity;
|
||||
|
||||
$scope.action = function (action, $event){
|
||||
/*
|
||||
Prevents default 'maximize' behaviour when clicking on
|
||||
notification button
|
||||
*/
|
||||
$event.stopPropagation();
|
||||
return action();
|
||||
};
|
||||
|
@ -21,11 +21,6 @@
|
||||
}
|
||||
],
|
||||
"controllers": [
|
||||
{
|
||||
"key": "MessageController",
|
||||
"implementation": "MessageController.js",
|
||||
"depends": ["$scope"]
|
||||
},
|
||||
{
|
||||
"key": "NotificationIndicatorController",
|
||||
"implementation": "NotificationIndicatorController.js",
|
||||
|
@ -26,25 +26,30 @@ define(
|
||||
function (MessageSeverity) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Provides an indicator that is visible when there are
|
||||
* banner notifications that have been minimized. Will also indicate
|
||||
* the number of notifications. Notifications can be viewed by
|
||||
* clicking on the indicator to launch a dialog showing a list of
|
||||
* notifications.
|
||||
* @param $scope
|
||||
* @param notificationService
|
||||
* @param dialogService
|
||||
* @constructor
|
||||
*/
|
||||
function NotificationIndicatorController($scope, notificationService, dialogService) {
|
||||
$scope.notifications = notificationService.notifications;
|
||||
$scope.highest = notificationService.highest;
|
||||
$scope.MessageSeverity = MessageSeverity;
|
||||
|
||||
/**
|
||||
* Launch a dialog showing a list of current notifications.
|
||||
*/
|
||||
$scope.showNotificationsList = function(){
|
||||
|
||||
var model = {
|
||||
title: "Messages",
|
||||
severity: MessageSeverity.INFO,
|
||||
actions: [
|
||||
{
|
||||
label: "Done",
|
||||
action: function () {
|
||||
dialogService.dismiss();
|
||||
}
|
||||
}
|
||||
],
|
||||
messages: []
|
||||
severity: MessageSeverity.INFO
|
||||
};
|
||||
|
||||
model.messages = notificationService.notifications;
|
||||
|
Loading…
x
Reference in New Issue
Block a user