blob: d09588a8cfcfcdacc4ac937dec3df32e520a713a [file] [log] [blame]
Iftekharul Islam99d199f2017-03-24 15:28:25 -05001window.angular && (function (angular) {
2 'use strict';
3
4 angular
5 .module('app.common.directives')
6 .directive('appNavigation', function () {
7 return {
8 'restrict': 'E',
9 'templateUrl': 'common/directives/app-navigation.html',
10 'scope': {
11 'path': '=',
12 'showNavigation': '='
13 },
14 'controller': ['$scope', 'dataService', function($scope, dataService){
15 $scope.$watch('showNavigation', function(){
16 var paddingTop = 0;
17 $scope.firstLevel = 'overview';
18 $scope.secondLevel = 'system_overview';
19 if($scope.showNavigation){
20 paddingTop = document.getElementById('header__wrapper').offsetHeight;
21 }
22 dataService.bodyStyle = {'padding-top': paddingTop + 'px'};
23 $scope.navStyle = {'top': paddingTop + 'px'};
24 });
25 }]
26 };
27 });
28})(window.angular);