mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 22:50:49 +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",
|
"key": "overlay",
|
||||||
"templateUrl": "templates/overlay.html"
|
"templateUrl": "templates/overlay.html"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"controllers": [
|
||||||
|
{
|
||||||
|
"key": "MessageController",
|
||||||
|
"implementation": "MessageController.js",
|
||||||
|
"depends": ["$scope"]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,10 +22,23 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['./MessageSeverity'],
|
['../../notification/src/MessageSeverity'],
|
||||||
function (MessageSeverity) {
|
function (MessageSeverity) {
|
||||||
"use strict";
|
"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) {
|
function MessageController($scope) {
|
||||||
$scope.MessageSeverity = MessageSeverity;
|
$scope.MessageSeverity = MessageSeverity;
|
||||||
}
|
}
|
@ -25,10 +25,29 @@ define(
|
|||||||
['../../../notification/src/MessageSeverity'],
|
['../../../notification/src/MessageSeverity'],
|
||||||
function (MessageSeverity) {
|
function (MessageSeverity) {
|
||||||
"use strict";
|
"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) {
|
function BannerController($scope, notificationService, dialogService) {
|
||||||
$scope.active = notificationService.active;
|
$scope.active = notificationService.active;
|
||||||
$scope.MessageSeverity = MessageSeverity;
|
$scope.MessageSeverity = MessageSeverity;
|
||||||
|
|
||||||
$scope.action = function (action, $event){
|
$scope.action = function (action, $event){
|
||||||
|
/*
|
||||||
|
Prevents default 'maximize' behaviour when clicking on
|
||||||
|
notification button
|
||||||
|
*/
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
return action();
|
return action();
|
||||||
};
|
};
|
||||||
|
@ -21,11 +21,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"controllers": [
|
"controllers": [
|
||||||
{
|
|
||||||
"key": "MessageController",
|
|
||||||
"implementation": "MessageController.js",
|
|
||||||
"depends": ["$scope"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "NotificationIndicatorController",
|
"key": "NotificationIndicatorController",
|
||||||
"implementation": "NotificationIndicatorController.js",
|
"implementation": "NotificationIndicatorController.js",
|
||||||
|
@ -26,25 +26,30 @@ define(
|
|||||||
function (MessageSeverity) {
|
function (MessageSeverity) {
|
||||||
"use strict";
|
"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) {
|
function NotificationIndicatorController($scope, notificationService, dialogService) {
|
||||||
$scope.notifications = notificationService.notifications;
|
$scope.notifications = notificationService.notifications;
|
||||||
$scope.highest = notificationService.highest;
|
$scope.highest = notificationService.highest;
|
||||||
$scope.MessageSeverity = MessageSeverity;
|
$scope.MessageSeverity = MessageSeverity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launch a dialog showing a list of current notifications.
|
||||||
|
*/
|
||||||
$scope.showNotificationsList = function(){
|
$scope.showNotificationsList = function(){
|
||||||
|
|
||||||
var model = {
|
var model = {
|
||||||
title: "Messages",
|
title: "Messages",
|
||||||
severity: MessageSeverity.INFO,
|
severity: MessageSeverity.INFO
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
label: "Done",
|
|
||||||
action: function () {
|
|
||||||
dialogService.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
messages: []
|
|
||||||
};
|
};
|
||||||
|
|
||||||
model.messages = notificationService.notifications;
|
model.messages = notificationService.notifications;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user