mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Common UI] Add in-line docs for Browse
Add in-line docs for bundle platform/commonUI/browse, which implements Browse mode, one of the common user interface bundles being transitioned in WTD-574.
This commit is contained in:
@ -9,23 +9,34 @@ define(
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
*
|
||||
* The navigate action navigates to a specific domain object.
|
||||
* @constructor
|
||||
*/
|
||||
function NavigateAction(navigationService, context) {
|
||||
function NavigateAction(navigationService, $q, context) {
|
||||
var domainObject = context.domainObject;
|
||||
|
||||
function perform() {
|
||||
return Promise.resolve(
|
||||
navigationService.setNavigation(domainObject)
|
||||
);
|
||||
// Set navigation, and wrap like a promise
|
||||
return $q.when(navigationService.setNavigation(domainObject));
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Navigate to the object described in the context.
|
||||
* @returns {Promise} a promise that is resolved once the
|
||||
* navigation has been updated
|
||||
*/
|
||||
perform: perform
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate as an action is only applicable when a domain object
|
||||
* is described in the action context.
|
||||
* @param {ActionContext} context the context in which the action
|
||||
* will be performed
|
||||
* @returns true if applicable
|
||||
*/
|
||||
NavigateAction.appliesTo = function (context) {
|
||||
return context.domainObject !== undefined;
|
||||
};
|
||||
|
Reference in New Issue
Block a user