Files
awx/awx/ui/client/lib/components/input/checkbox.directive.js
gconsidine c57c17546e Update UI build system
* Faster build times
* Smaller bundle sizes
* Adjust paths
* Cleanup npm dependencies
* Remove unneded Grunt tasks
2017-09-07 18:09:14 -04:00

47 lines
1.2 KiB
JavaScript

const templateUrl = require('@components/input/checkbox.partial.html');
function atInputCheckboxLink (scope, element, attrs, controllers) {
let formController = controllers[0];
let inputController = controllers[1];
if (scope.tab === '1') {
element.find('input')[0].focus();
}
inputController.init(scope, element, formController);
}
function AtInputCheckboxController (baseInputController) {
let vm = this || {};
vm.init = (scope, element, form) => {
baseInputController.call(vm, 'input', scope, element, form);
scope.label = scope.state.label;
scope.state.label = vm.strings.get('OPTIONS');
vm.check();
};
}
AtInputCheckboxController.$inject = ['BaseInputController'];
function atInputCheckbox () {
return {
restrict: 'E',
transclude: true,
replace: true,
require: ['^^atForm', 'atInputCheckbox'],
templateUrl,
controller: AtInputCheckboxController,
controllerAs: 'vm',
link: atInputCheckboxLink,
scope: {
state: '=',
col: '@',
tab: '@'
}
};
}
export default atInputCheckbox;