From a1942e65cd56fac421643cea0a07b23c4122ca48 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Aug 2015 00:14:32 -0400 Subject: [PATCH] update interger directive instead of doing awnodash --- awx/ui/client/src/shared/directives.js | 8 ++++++-- awx/ui/templates/ui/index.html | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js index dc5869e29f..18d8e707ed 100644 --- a/awx/ui/client/src/shared/directives.js +++ b/awx/ui/client/src/shared/directives.js @@ -293,8 +293,12 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job if (/^\-?\d*$/.test(viewValue)) { // it is valid ctrl.$setValidity('integer', true); - if ( elm.attr('min') && - ( viewValue === '' || viewValue === null || parseInt(viewValue,10) < parseInt(elm.attr('min'),10) ) ) { + if ( viewValue === '-' || viewValue === '' || viewValue === null) { + ctrl.$setValidity('integer', false); + return viewValue; + } + if (elm.attr('min') && + parseInt(viewValue,10) < parseInt(elm.attr('min'),10) ) { ctrl.$setValidity('min', false); return viewValue; } diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index decd437eaf..63d63ebd76 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -158,7 +158,7 @@