mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 01:11:41 +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,
|
currentParent,
|
||||||
parents = [];
|
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
|
// Record this object
|
||||||
parents.unshift(currentObj);
|
parents.unshift(currentParent);
|
||||||
|
|
||||||
// Get the next one up the tree
|
// Get the next one up the tree
|
||||||
currentParent = currentObj.getCapability('context').getParent();
|
|
||||||
currentObj = currentParent;
|
currentObj = currentParent;
|
||||||
|
currentParent = currentObj.getCapability('context').getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.contextutalParents = parents;
|
$scope.contextutalParents = parents;
|
||||||
@ -66,7 +71,7 @@ define(
|
|||||||
// If this the the initial call of this recursive function
|
// If this the the initial call of this recursive function
|
||||||
if (!current) {
|
if (!current) {
|
||||||
current = $scope.ngModel.selectedObject;
|
current = $scope.ngModel.selectedObject;
|
||||||
$scope.primaryParents = [current];
|
$scope.primaryParents = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
location = current.getModel().location;
|
location = current.getModel().location;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user