Skip to content

Commit

Permalink
Ajuste no botão de pagamento para evitar que o usuário consiga pressi…
Browse files Browse the repository at this point in the history
…oná-lo enquanto o pagamento está sendo feito.
  • Loading branch information
Marcelo Palladino committed Oct 17, 2016
1 parent 9f9b2b0 commit a65b7b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Client/app/controllers/faturamentoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var vm = this;
vm.site = null;
vm.faturaAtual = null;
vm.estaEfetuandoPagamento = false;
vm.pagar = pagar;

montaFaturaAtual();
Expand All @@ -28,12 +29,14 @@
};

function pagar() {
vm.estaEfetuandoPagamento = true
faturamentoService.pagar(vm.faturaAtual)
.$promise.then(
function (resultado) {
$window.location.href = resultado.url;
},
function (erro) {
vm.estaEfetuandoPagamento = false
growlService.growlError(erro.data.Mensagem);
});
};
Expand Down
2 changes: 1 addition & 1 deletion Client/app/views/faturamento.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h5 class="text-uppercase f-400">Usuários</h5>
</table>

<footer class="m-t-15 p-20">
<button type="button" class="btn btn-primary btn-center" ng-click="faturamentoCtrl.pagar()">Pagar esta fatura</button>
<button type="button" class="btn btn-primary btn-center" ng-click="faturamentoCtrl.pagar()" ng-disabled="faturamentoCtrl.estaEfetuandoPagamento">Pagar esta fatura</button>
</footer>
</div>
</div>
Expand Down

0 comments on commit a65b7b9

Please sign in to comment.