From d7c2fa15a0a7846878a79587ce83fc789350ceab Mon Sep 17 00:00:00 2001 From: marlonfurtado Date: Wed, 9 Nov 2016 10:46:03 -0200 Subject: [PATCH] #5 <@marlonfurtado, @souzabruna> - arrumar botao limpar --- .../javascripts/services/validate_form_service.js | 11 +++++++++-- .../registrations/_form_v2.html.erb | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/services/validate_form_service.js b/app/assets/javascripts/services/validate_form_service.js index 39260a2..2819217 100644 --- a/app/assets/javascripts/services/validate_form_service.js +++ b/app/assets/javascripts/services/validate_form_service.js @@ -36,13 +36,14 @@ var validateFormService = (function(){ invalidButtonBank = true; } } + var buttonRegisterBank = document.querySelector('.js-validateButtonBank'); if(buttonRegisterBank != null){ if(!invalidButtonBank){ buttonChange("actived", buttonRegisterBank); buttonRegisterBank.addEventListener('click', function(){ Modal.open('.js-modalMessageRegisterBank'); - }); + }) }else{ buttonChange("disabled", buttonRegisterBank); } @@ -69,7 +70,7 @@ var validateFormService = (function(){ }; var buttonValidSimpleFormDonator = function(selector){ - if(elementExist(selector)) return false + //if(elementExist(selector)) return false; var invalidButtonSimpleDonator = false; for(var i = 0; i < validSimpleFormDonator.length; i++){ if(validSimpleFormDonator[i] == false){ @@ -407,7 +408,13 @@ var validateFormService = (function(){ disableButton: function(){ toggleValidateButton(false); + }, + + buttonReset: function(){ + var buttonRegisterSimpleDonator = document.querySelector('.js-validateButtonSimpleDonator'); + buttonChange("disabled", buttonRegisterSimpleDonator); } + } })() diff --git a/app/views/user_blood_donators/registrations/_form_v2.html.erb b/app/views/user_blood_donators/registrations/_form_v2.html.erb index 44925d5..3c96b44 100644 --- a/app/views/user_blood_donators/registrations/_form_v2.html.erb +++ b/app/views/user_blood_donators/registrations/_form_v2.html.erb @@ -145,7 +145,7 @@