[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:
Victor Woeltjen
2014-11-25 16:53:22 -08:00
parent b97e2d0324
commit 36fab50825
8 changed files with 116 additions and 39 deletions

View File

@ -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;
};