Line | |
---|
1 | (function () {
|
---|
2 | var module = appMainModule.getAngularModule();
|
---|
3 | module.controller('app.menu',
|
---|
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 loc = viewLocation.toUpperCase().substr(1);
|
---|
10 | var actualLocation = $location.path().toUpperCase();
|
---|
11 | var splitLoc = loc.split("/");
|
---|
12 | if (splitLoc.length <= 2) {
|
---|
13 | var actualLocationSplit = actualLocation.split("/");
|
---|
14 | if (actualLocationSplit.length > 1) {
|
---|
15 | if (splitLoc[1] == actualLocationSplit[1]) {
|
---|
16 | return true;
|
---|
17 | }
|
---|
18 | }
|
---|
19 | }
|
---|
20 | return $location.path().toUpperCase() == loc;
|
---|
21 | };
|
---|
22 |
|
---|
23 | $scope.logout = function() {
|
---|
24 | authService.logout({}, function() {
|
---|
25 | $window.location.hash = "";
|
---|
26 | $window.location.reload();
|
---|
27 | });
|
---|
28 | };
|
---|
29 | }]
|
---|
30 | );
|
---|
31 | })(); |
---|
Note: See
TracBrowser
for help on using the repository browser.