From d654204168e7421cec3d284ee67ba8303b4ec410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Centuri=C3=B3n?= Date: Wed, 11 Nov 2015 09:53:50 -0300 Subject: [PATCH] Fix force request --- dist/scripts/api-console.js | 10 +--------- src/app/directives/sidebar.js | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/dist/scripts/api-console.js b/dist/scripts/api-console.js index 634f32555..c7c16284e 100644 --- a/dist/scripts/api-console.js +++ b/dist/scripts/api-console.js @@ -1136,13 +1136,7 @@ var keys = Object.keys(form.form).filter(function (key) { return key.indexOf('$') === -1;}); keys.forEach(function (fieldName) { - var value = angular.copy(form.form[fieldName].$viewValue); - - value = value || ''; - - console.log(value); - - form.form[fieldName].$setViewValue(value); + form.form[fieldName].$setDirty(); }); return form.form.$valid; @@ -1360,8 +1354,6 @@ jQuery($event.currentTarget).closest('form').find('.ng-invalid').first().focus(); } - // console.log($scope.form.$valid); - if($scope.context.forceRequest || validateForm($scope.form)) { var url; var context = $scope.context; diff --git a/src/app/directives/sidebar.js b/src/app/directives/sidebar.js index 86d14f4ec..654d4b419 100644 --- a/src/app/directives/sidebar.js +++ b/src/app/directives/sidebar.js @@ -157,13 +157,7 @@ var keys = Object.keys(form.form).filter(function (key) { return key.indexOf('$') === -1;}); keys.forEach(function (fieldName) { - var value = angular.copy(form.form[fieldName].$viewValue); - - value = value || ''; - - console.log(value); - - form.form[fieldName].$setViewValue(value); + form.form[fieldName].$setDirty(); }); return form.form.$valid; @@ -381,8 +375,6 @@ jQuery($event.currentTarget).closest('form').find('.ng-invalid').first().focus(); } - // console.log($scope.form.$valid); - if($scope.context.forceRequest || validateForm($scope.form)) { var url; var context = $scope.context;