mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Addressability] Update path on navigation
Update path in browse mode when navigation state changes. WTD-1149.
This commit is contained in:
parent
9fae2db04a
commit
084d6b6859
@ -14,7 +14,7 @@
|
||||
{
|
||||
"key": "BrowseController",
|
||||
"implementation": "BrowseController.js",
|
||||
"depends": [ "$scope", "$routeParams", "objectService", "navigationService" ]
|
||||
"depends": [ "$scope", "$route", "$location", "objectService", "navigationService" ]
|
||||
},
|
||||
{
|
||||
"key": "CreateMenuController",
|
||||
|
@ -41,17 +41,28 @@ define(
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function BrowseController($scope, $routeParams, objectService, navigationService) {
|
||||
function BrowseController($scope, $routeParams, $location, objectService, navigationService) {
|
||||
var path = [ROOT_ID].concat(
|
||||
($routeParams.ids || DEFAULT_PATH).split("/")
|
||||
);
|
||||
|
||||
function updateRoute(domainObject) {
|
||||
var context = domainObject.getCapability('context'),
|
||||
objectPath = context.getPath(),
|
||||
ids = objectPath.map(function (domainObject) {
|
||||
return domainObject.getId();
|
||||
});
|
||||
|
||||
$location.path("/browse/" + ids.slice(1).join("/"));
|
||||
}
|
||||
|
||||
// Callback for updating the in-scope reference to the object
|
||||
// that is currently navigated-to.
|
||||
function setNavigation(domainObject) {
|
||||
$scope.navigatedObject = domainObject;
|
||||
$scope.treeModel.selectedObject = domainObject;
|
||||
navigationService.setNavigation(domainObject);
|
||||
updateRoute(domainObject);
|
||||
}
|
||||
|
||||
function navigateTo(domainObject) {
|
||||
|
Loading…
Reference in New Issue
Block a user