Change navigation structure
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/directives/app-navigation.js b/app/common/directives/app-navigation.js
index d09588a..6939a3c 100644
--- a/app/common/directives/app-navigation.js
+++ b/app/common/directives/app-navigation.js
@@ -11,11 +11,20 @@
'path': '=',
'showNavigation': '='
},
- 'controller': ['$scope', 'dataService', function($scope, dataService){
+ 'controller': ['$scope', '$location', 'dataService', function($scope, $location, dataService){
+ $scope.change = function(firstLevel){
+ $scope.firstLevel = firstLevel;
+ $location.path('/'+firstLevel);
+ }
$scope.$watch('showNavigation', function(){
var paddingTop = 0;
- $scope.firstLevel = 'overview';
- $scope.secondLevel = 'system_overview';
+ var urlRoot = $location.path().split("/")[1];
+ if(urlRoot != ""){
+ $scope.firstLevel = urlRoot;
+ }else{
+ $scope.firstLevel = 'overview';
+ }
+
if($scope.showNavigation){
paddingTop = document.getElementById('header__wrapper').offsetHeight;
}