Last change
on this file since 14648 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
|
Rev | Line | |
---|
[12428] | 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) {
|
---|
[12563] | 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;
|
---|
[12428] | 21 | }
|
---|
| 22 | }
|
---|
[12563] | 23 | return true;
|
---|
[12428] | 24 | }
|
---|
[12563] | 25 | return false;
|
---|
[12428] | 26 | };
|
---|
| 27 |
|
---|
[12563] | 28 | $scope.logout = function () {
|
---|
| 29 | authService.logout({}, function () {
|
---|
[12428] | 30 | $window.location.hash = "";
|
---|
| 31 | $window.location.reload();
|
---|
| 32 | });
|
---|
| 33 | };
|
---|
[12563] | 34 |
|
---|
| 35 | $scope.hideMenu = function () {
|
---|
| 36 | $(".navbar-collapse").collapse('hide');
|
---|
| 37 | };
|
---|
[12428] | 38 | }]
|
---|
| 39 | );
|
---|
| 40 | })(); |
---|
Note: See
TracBrowser
for help on using the repository browser.