mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-15 02:21:28 +02:00
New 0.4 version
This commit is contained in:
23
modules/core/client/controllers/header.client.controller.js
Normal file
23
modules/core/client/controllers/header.client.controller.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('core').controller('HeaderController', ['$scope', '$state', 'Authentication', 'Menus',
|
||||
function($scope, $state, Authentication, Menus) {
|
||||
// Expose view variables
|
||||
$scope.$state = $state;
|
||||
$scope.authentication = Authentication;
|
||||
|
||||
// Get the topbar menu
|
||||
$scope.menu = Menus.getMenu('topbar');
|
||||
|
||||
// Toggle the menu items
|
||||
$scope.isCollapsed = false;
|
||||
$scope.toggleCollapsibleMenu = function() {
|
||||
$scope.isCollapsed = !$scope.isCollapsed;
|
||||
};
|
||||
|
||||
// Collapsing the menu after navigation
|
||||
$scope.$on('$stateChangeSuccess', function() {
|
||||
$scope.isCollapsed = false;
|
||||
});
|
||||
}
|
||||
]);
|
||||
Reference in New Issue
Block a user