From a0169ad1585326ff24540b3e3b9860c40212f308 Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Wed, 26 Aug 2015 20:20:16 -0700 Subject: [PATCH] [Mobile] Browse Controller Adjusted BrowseController to hide the back button if current object represented/ selected has no context. --- platform/commonUI/browse/src/BrowseController.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/browse/src/BrowseController.js b/platform/commonUI/browse/src/BrowseController.js index d1f89d43fb..d1ec4d33e0 100644 --- a/platform/commonUI/browse/src/BrowseController.js +++ b/platform/commonUI/browse/src/BrowseController.js @@ -150,9 +150,15 @@ define( } function checkRoot() { - var parent = navigationService.getNavigation().getCapability('context').getParent(); - if (parent.getId() !== ROOT_ID) { - $scope.atRoot = false; + var context = navigationService.getNavigation().getCapability('context'), + parent; + if (context) { + parent = context.getParent(); + if (parent.getId() !== ROOT_ID) { + $scope.atRoot = false; + } else { + $scope.atRoot = true; + } } else { $scope.atRoot = true; }