Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
#5 <@marlonfurtado, @souzabruna> - arrumar botao limpar
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonfurtado committed Nov 9, 2016
1 parent 276edb0 commit d7c2fa1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/assets/javascripts/services/validate_form_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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){
Expand Down Expand Up @@ -407,7 +408,13 @@ var validateFormService = (function(){

disableButton: function(){
toggleValidateButton(false);
},

buttonReset: function(){
var buttonRegisterSimpleDonator = document.querySelector('.js-validateButtonSimpleDonator');
buttonChange("disabled", buttonRegisterSimpleDonator);
}

}

})()
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@

<div class="Container-footer">
<div class="u-float-right">
<button name="button" type="reset" class="Button Button--invisible">Limpar</button>
<button name="button" type="reset" class="Button Button--invisible" onclick="validateFormService.buttonReset()">Limpar</button>
<input type="submit" name="commit" value="Cadastrar" class="Button is-disabled js-validateButtonSimpleDonator" data-disable-with="Cadastrar">
</div>
<div class="Button" onclick="Modal.close('.js-modalRegistration')"> Voltar </div>
Expand Down

0 comments on commit d7c2fa1

Please sign in to comment.