1window.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);
29