From 2fb4e9a22746962f0aa8b536b37a7ca8ba7d828c Mon Sep 17 00:00:00 2001 From: baldo Date: Tue, 17 May 2016 12:02:55 +0200 Subject: [PATCH] Validate only text inputs. --- app/scripts/directives/nodeForm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/directives/nodeForm.js b/app/scripts/directives/nodeForm.js index 3b891f3..ab742f5 100644 --- a/app/scripts/directives/nodeForm.js +++ b/app/scripts/directives/nodeForm.js @@ -128,7 +128,8 @@ angular.module('ffffng') var doSubmit = function (node) { if ($scope.nodeForm.$invalid) { var firstInvalid = _.filter($element.find('form').find('input'), function (input) { - return input.name !== 'leaflet-base-layers' && $scope.nodeForm[input.name].$invalid; + return (input.type === 'text' || input.type === 'email') + && $scope.nodeForm[input.name].$invalid; })[0]; if (firstInvalid) { $window.scrollTo(0, $window.pageYOffset + firstInvalid.getBoundingClientRect().top - 100);