mirror of
https://github.com/nasa/openmct.git
synced 2024-12-28 08:58:52 +00:00
[Inspector] Location does not include self
Changed the object inspector's location getting to not include the object itself in the location, just its ancestors. #73.
This commit is contained in:
parent
5080b5296e
commit
c3e5fbf713
@ -46,13 +46,18 @@ define(
|
||||
currentParent,
|
||||
parents = [];
|
||||
|
||||
while (currentObj && currentObj.getModel().type !== 'root' && currentObj.hasCapability('context')) {
|
||||
currentParent = currentObj &&
|
||||
currentObj.hasCapability('context') &&
|
||||
currentObj.getCapability('context').getParent();
|
||||
|
||||
while (currentParent && currentParent.getModel().type !== 'root' &&
|
||||
currentParent.hasCapability('context')) {
|
||||
// Record this object
|
||||
parents.unshift(currentObj);
|
||||
parents.unshift(currentParent);
|
||||
|
||||
// Get the next one up the tree
|
||||
currentParent = currentObj.getCapability('context').getParent();
|
||||
currentObj = currentParent;
|
||||
currentParent = currentObj.getCapability('context').getParent();
|
||||
}
|
||||
|
||||
$scope.contextutalParents = parents;
|
||||
@ -66,7 +71,7 @@ define(
|
||||
// If this the the initial call of this recursive function
|
||||
if (!current) {
|
||||
current = $scope.ngModel.selectedObject;
|
||||
$scope.primaryParents = [current];
|
||||
$scope.primaryParents = [];
|
||||
}
|
||||
|
||||
location = current.getModel().location;
|
||||
|
Loading…
Reference in New Issue
Block a user