mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-14 03:12:21 +01:00
27 lines
744 B
JavaScript
27 lines
744 B
JavaScript
'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');
|
|
|
|
// Get the account menu
|
|
$scope.accountMenu = Menus.getMenu('account').items[0];
|
|
|
|
// 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;
|
|
});
|
|
}
|
|
]);
|