mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
Merge pull request #83 from ansible/fix_range_check
fixing range bug with awMax directive
This commit is contained in:
@@ -151,9 +151,22 @@ export default
|
|||||||
e = angular.element(document.getElementById('prompt_for_days_form'));
|
e = angular.element(document.getElementById('prompt_for_days_form'));
|
||||||
scope.prompt_for_days_form.days_to_keep.$setViewValue(30);
|
scope.prompt_for_days_form.days_to_keep.$setViewValue(30);
|
||||||
$compile(e)(scope);
|
$compile(e)(scope);
|
||||||
$('#prompt-for-days-launch').attr("ng-disabled", 'prompt_for_days_form.$invalid');
|
|
||||||
e = angular.element(document.getElementById('prompt-for-days-launch'));
|
// this is a work-around for getting awMax to work (without
|
||||||
$compile(e)(scope);
|
// clearing out the form)
|
||||||
|
scope.$watch('days_to_keep', function(newVal, oldVal, scope) {
|
||||||
|
if (!newVal) {
|
||||||
|
$('#prompt-for-days-launch').prop("disabled", true);
|
||||||
|
} else if (isNaN(newVal)) {
|
||||||
|
$('#prompt-for-days-launch').prop("disabled", true);
|
||||||
|
} else if (newVal <= 0) {
|
||||||
|
$('#prompt-for-days-launch').prop("disabled", true);
|
||||||
|
} else if (newVal > 9999) {
|
||||||
|
$('#prompt-for-days-launch').prop("disabled", true);
|
||||||
|
} else {
|
||||||
|
$('#prompt-for-days-launch').prop("disabled", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
buttons: [{
|
buttons: [{
|
||||||
"label": "Cancel",
|
"label": "Cancel",
|
||||||
|
|||||||
Reference in New Issue
Block a user