mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-06-18 20:40:57 +02:00
feat(core): Modify core module to implement style guidelines.
Update the core module to implement the style guidelines. Reduce size of init.js - moved filter logic out to it's own config. Rename Menus to menuService
This commit is contained in:
committed by
Ryan Hutchison
parent
59e6daa63d
commit
b2462ec86c
@@ -1,26 +1,25 @@
|
||||
'use strict';
|
||||
(function () {
|
||||
'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;
|
||||
angular
|
||||
.module('core')
|
||||
.controller('HeaderController', HeaderController);
|
||||
|
||||
// Get the topbar menu
|
||||
$scope.menu = Menus.getMenu('topbar');
|
||||
HeaderController.$inject = ['$scope', '$state', 'Authentication', 'menuService'];
|
||||
|
||||
// Get the account menu
|
||||
$scope.accountMenu = Menus.getMenu('account').items[0];
|
||||
function HeaderController($scope, $state, Authentication, menuService) {
|
||||
var vm = this;
|
||||
|
||||
// Toggle the menu items
|
||||
$scope.isCollapsed = false;
|
||||
$scope.toggleCollapsibleMenu = function () {
|
||||
$scope.isCollapsed = !$scope.isCollapsed;
|
||||
};
|
||||
vm.accountMenu = menuService.getMenu('account').items[0];
|
||||
vm.authentication = Authentication;
|
||||
vm.isCollapsed = false;
|
||||
vm.menu = menuService.getMenu('topbar');
|
||||
|
||||
// Collapsing the menu after navigation
|
||||
$scope.$on('$stateChangeSuccess', function () {
|
||||
$scope.isCollapsed = false;
|
||||
});
|
||||
$scope.$on('$stateChangeSuccess', stateChangeSuccess);
|
||||
|
||||
function stateChangeSuccess() {
|
||||
// Collapsing the menu after navigation
|
||||
vm.isCollapsed = false;
|
||||
}
|
||||
}
|
||||
]);
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user