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:
Ryan Hutchison
2016-02-11 00:20:17 -05:00
committed by Ryan Hutchison
parent 59e6daa63d
commit b2462ec86c
28 changed files with 613 additions and 536 deletions

View File

@@ -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;
}
}
]);
}());