From f3037a3b067b945e8aa85610ef3a8aed47724a04 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 1 Dec 2014 16:01:17 -0500 Subject: [PATCH] Improved ngmin/ngmax the ngmin/ngmax directives were failing out if the user never set the ngmin/ngmax (which could happen). added a check to for empty ngmin's/ngmax's --- awx/ui/static/lib/ansible/directives.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 362fbbb4a2..18e0a5ff0b 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -151,7 +151,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job link: function (scope, elem, attr, ctrl) { ctrl.$parsers.unshift( function(viewValue) { var min = (attr.ngMin) ? scope.$eval(attr.ngMin) : -Infinity; - if (!Empty(viewValue) && Number(viewValue) < min) { + if (!Empty(min) && !Empty(viewValue) && Number(viewValue) < min) { ctrl.$setValidity('ngMin', false); return undefined; } else { @@ -170,7 +170,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job link: function (scope, elem, attr, ctrl) { ctrl.$parsers.unshift( function(viewValue) { var max = (attr.ngMax) ? scope.$eval(attr.ngMax) : Infinity; - if (!Empty(viewValue) && Number(viewValue) > max) { + if (!Empty(max) && !Empty(viewValue) && Number(viewValue) > max) { ctrl.$setValidity('ngMax', false); return undefined; } else {