[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:
slhale 2015-08-25 13:06:15 -07:00
parent 5080b5296e
commit c3e5fbf713

View File

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