1 define(['common/topbar/topbar.module', 'common/topbar/topbar.directives', 'common/authentification/auth.services'], function(topbar) {
3 topbar.controller('TopbarCtrl', function() {
4 $('#toggleMenu').click(function(e) {
6 $('#wrapper').toggleClass('toggled');
10 topbar.controller('topBarTasksCtrl', function($scope, taskFactory) {
11 $scope.tasks = taskFactory.getTaskData();
14 topbar.controller('topBarNotifsCtrl', function($scope, notifsFactory) {
15 $scope.notifs = notifsFactory.getNotifsData();
16 $scope.isValid = function(value) {
17 if (angular.isUndefined(value) || value === null) {
25 topbar.controller('topBarMessagesCtrl', function($scope, messageFactory) {
26 $scope.messages = messageFactory.getMessageData();
27 $scope.isValid = function(value) {
28 if (angular.isUndefined(value) || value === null) {
36 // the authorization module is not converted yet
37 topbar.controller('topBarUserMenuCtrl', function($scope, $cookieStore, Auth, $window) {
38 $scope.logOut = logout;
41 * Provides logout from application and redirects to login page
42 * @return {[type]} [description]
45 Auth.logout(function() {
46 $window.location.href = 'index.html#/login';
50 $scope.getUsername = function() {
51 return $window.localStorage.odlUser;