Disable button on action
This commit is contained in:
parent
4facfe4f6c
commit
16b4d9738d
|
@ -391,6 +391,8 @@
|
||||||
const network = $(this).data('network');
|
const network = $(this).data('network');
|
||||||
const country = $(this).data('country');
|
const country = $(this).data('country');
|
||||||
const email = $(this).data('email');
|
const email = $(this).data('email');
|
||||||
|
let button = $(this)
|
||||||
|
button.prop("disabled",true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/resetWalletPassword')?>',
|
url: '<?php echo base_url('index.php/Hyperviseur_dash/resetWalletPassword')?>',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -420,7 +422,9 @@
|
||||||
error: function (resultat, statut, error) {
|
error: function (resultat, statut, error) {
|
||||||
console.log(resultat + " " + error);
|
console.log(resultat + " " + error);
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
},
|
||||||
|
complete: function (){
|
||||||
|
button.prop("disabled",false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -430,11 +434,13 @@
|
||||||
|
|
||||||
const salt = $(this).data('salt');
|
const salt = $(this).data('salt');
|
||||||
const encrypted_password = $(this).data('encrypted_password');
|
const encrypted_password = $(this).data('encrypted_password');
|
||||||
|
let button = $(this);
|
||||||
|
|
||||||
if ($('#payCommissionForm')[0].checkValidity()) {
|
if ($('#payCommissionForm')[0].checkValidity()) {
|
||||||
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
|
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
|
||||||
const password = $('#password').val();
|
const password = $('#password').val();
|
||||||
|
|
||||||
|
button.prop("disabled",true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/pay_commission_in_cash')?>',
|
url: '<?php echo base_url('index.php/Hyperviseur_dash/pay_commission_in_cash')?>',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -467,6 +473,9 @@
|
||||||
error: function (resultat, statut, error) {
|
error: function (resultat, statut, error) {
|
||||||
console.log(resultat + " " + error);
|
console.log(resultat + " " + error);
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
},
|
||||||
|
complete : function () {
|
||||||
|
button.prop("disabled",false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -301,6 +301,8 @@
|
||||||
<script>
|
<script>
|
||||||
$(document).on("click", "#cancelDemand", function () {
|
$(document).on("click", "#cancelDemand", function () {
|
||||||
const id_demand = $(this).data('id-demand');
|
const id_demand = $(this).data('id-demand');
|
||||||
|
let button = $(this)
|
||||||
|
button.prop("disabled",true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
|
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -322,10 +324,12 @@
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (resultat, statut, erreur) {
|
error: function (resultat, statut, erreur) {
|
||||||
console.log(resultat + " " + erreur);
|
console.log(resultat + " " + erreur);
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
},
|
||||||
|
complete: function (){
|
||||||
|
button.prop("disabled",false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -335,6 +335,8 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).on("click", "#cancel", function () {
|
$(document).on("click", "#cancel", function () {
|
||||||
|
let button = $(this);
|
||||||
|
button.prop("disabled",true);
|
||||||
const id_transaction = $(this).data('id-transaction');
|
const id_transaction = $(this).data('id-transaction');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : '<?php echo base_url('index.php/Gestion/cancelTransation')?>',
|
url : '<?php echo base_url('index.php/Gestion/cancelTransation')?>',
|
||||||
|
@ -357,15 +359,19 @@
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error : function(resultat, statut, erreur){
|
error : function(resultat, statut, erreur){
|
||||||
console.log(resultat+" "+erreur);
|
console.log(resultat+" "+erreur);
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
},
|
||||||
|
complete: function (){
|
||||||
|
button.prop("disabled",false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#delete').click(function(){
|
$('#delete').click(function(){
|
||||||
|
let button = $(this);
|
||||||
|
button.prop('disabled', true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : '<?php echo base_url('index.php/Hyperviseur_dash/delete_wallet_transaction')?>',
|
url : '<?php echo base_url('index.php/Hyperviseur_dash/delete_wallet_transaction')?>',
|
||||||
type : 'POST',
|
type : 'POST',
|
||||||
|
@ -386,11 +392,14 @@
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error : function(resultat, statut, erreur){
|
error : function(resultat, statut, erreur){
|
||||||
console.log(resultat+" "+erreur);
|
console.log(resultat+" "+erreur);
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||||
}
|
},
|
||||||
|
|
||||||
|
complete: function (){
|
||||||
|
button.prop('disabled', false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue