diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index c6d0b02be2..6d5b16096e 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -63,6 +63,50 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job }; }) + +// .directive('surveyCheckboxes', function(){ +// return { +// restrict: 'E', +// require: 'ngModel', +// scope: { 'ngModel': '=accessor' }, +// template: '
' +// +'' +// +'
', +// link: function(scope, element, attrs, ctrl){ +// scope.cbModel= {}; + +// ctrl.$parsers.unshift(function(value){ +// for (var c in scope.cbModel) { +// if (scope.cbModel[c]) { +// ctrl.$setValidity('checkbox', true); +// } +// } +// ctrl.$setValidity('checkbox', false); +// }); + +// scope.update = function(){ +// var val = []; +// angular.forEach(scope.cbModel, function(v,k){ +// if (v) +// val.push(k); +// }); +// if (val.length>0) +// scope.ngModel().value = angular.toJson(val); +// }; + +// scope.isRequired = function(){ +// if (!scope.ngModel().required) return false; + +// return scope.ngModel().required; +// }; +// } +// }; +// }) + // caplitalize Add to any input field where the first letter of each // word should be capitalized. Use in place of css test-transform. // For some reason "text-transform: capitalize" in breadcrumbs