1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

include -0 as an invalid integer in the context of this directive

This commit is contained in:
John Mitchell 2015-08-11 17:18:49 -04:00
parent aef95b2c1a
commit 66b1d2d28f

View File

@ -275,7 +275,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
if (/^\-?\d*$/.test(viewValue)) { if (/^\-?\d*$/.test(viewValue)) {
// it is valid // it is valid
ctrl.$setValidity('integer', true); ctrl.$setValidity('integer', true);
if ( viewValue === '-' || viewValue === '' || viewValue === null) { if ( viewValue === '-' || viewValue === '-0' || viewValue === '' || viewValue === null) {
ctrl.$setValidity('integer', false); ctrl.$setValidity('integer', false);
return viewValue; return viewValue;
} }