From c3e5fbf713b204e520cfaf388e97f53478fd7e81 Mon Sep 17 00:00:00 2001 From: slhale Date: Tue, 25 Aug 2015 13:06:15 -0700 Subject: [PATCH] [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. --- .../src/controllers/ObjectInspectorController.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/general/src/controllers/ObjectInspectorController.js b/platform/commonUI/general/src/controllers/ObjectInspectorController.js index 2f8528669f..5b04304af0 100644 --- a/platform/commonUI/general/src/controllers/ObjectInspectorController.js +++ b/platform/commonUI/general/src/controllers/ObjectInspectorController.js @@ -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;