mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
implement componenitized navigation and remove old nav and layout code
This commit is contained in:
32
awx/ui/client/lib/components/layout/side-nav.directive.js
Normal file
32
awx/ui/client/lib/components/layout/side-nav.directive.js
Normal file
@@ -0,0 +1,32 @@
|
||||
function atSideNavLink (scope, element, attrs, ctrl) {
|
||||
scope.layoutVm = ctrl;
|
||||
}
|
||||
|
||||
function AtSideNavController () {
|
||||
let vm = this || {};
|
||||
|
||||
vm.isExpanded = true;
|
||||
|
||||
vm.toggleExpansion = () => {
|
||||
vm.isExpanded = !vm.isExpanded;
|
||||
}
|
||||
}
|
||||
|
||||
function atSideNav (pathService) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
require: '^^atLayout',
|
||||
controller: AtSideNavController,
|
||||
controllerAs: 'vm',
|
||||
link: atSideNavLink,
|
||||
transclude: true,
|
||||
templateUrl: pathService.getPartialPath('components/layout/side-nav'),
|
||||
scope: {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
atSideNav.$inject = ['PathService'];
|
||||
|
||||
export default atSideNav;
|
||||
Reference in New Issue
Block a user