mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 14:38:00 -03:30
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
This commit is contained in:
parent
fc5eb09e2a
commit
f3037a3b06
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user