Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Services.WebApp/3.3/WebApp/shared/menu/menuCtrl.js @ 13180

Last change on this file since 13180 was 12563, checked in by ascheibe, 9 years ago

#2394 merged r12428, r12429, r12430, r12435, r12442, r12443, r12445, r12514, r12517, r12519, r12520, r12521, r12523, r12532, r12542, r12546, r12552, r12553, r12556, r12557, r12559, r12561, r12146, r12457 into stable

File size: 1.7 KB
Line 
1(function () {
2    var module = appMainPlugin.getAngularModule();
3    module.controller('app.menu.ctrl',
4        ['$scope', '$timeout', '$location', '$window', 'app.authentication.service',
5        function ($scope, $timeout, $location, $window, authService) {
6            $scope.modules = app.modules;
7            $scope.menuEntries = app.getMenu().getMenuEntries();
8            $scope.isActive = function (viewLocation) {
9                var linkLocation = viewLocation.toUpperCase().substr(1);
10                var currentLocation = $location.path().toUpperCase();
11                if (linkLocation == currentLocation) {
12                    return true;
13                }
14                var linkLocationParts = linkLocation.split("/");
15                var currentLocationParts = currentLocation.split("/");
16                var linkLocationPartsLength = linkLocationParts.length;
17                if (linkLocationPartsLength < currentLocationParts.length) {
18                    for (var i = 0; i < linkLocationPartsLength; ++i) {
19                        if (linkLocationParts[i] !== currentLocationParts[i]) {
20                            return false;
21                        }
22                    }
23                    return true;
24                }
25                return false;
26            };
27
28            $scope.logout = function () {
29                authService.logout({}, function () {
30                    $window.location.hash = "";
31                    $window.location.reload();
32                });
33            };
34
35            $scope.hideMenu = function () {
36                $(".navbar-collapse").collapse('hide');
37            };
38        }]
39    );
40})();
Note: See TracBrowser for help on using the repository browser.