Add better spinner
This commit is contained in:
parent
4265123589
commit
e1210d291b
@ -189,11 +189,11 @@ function noticeSlipPayAndFinish() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitNoticeSlip() {
|
function submitNoticeSlip() {
|
||||||
app.preloader.show();
|
app.dialog.preloader("Sending...");
|
||||||
stripe.createPaymentMethod({type: 'card', card: card}).then(function (result) {
|
stripe.createPaymentMethod({type: 'card', card: card}).then(function (result) {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
// Inform the customer that there was an error.
|
// Inform the customer that there was an error.
|
||||||
app.preloader.hide();
|
app.dialog.close();
|
||||||
var errorElement = document.getElementById('noticeslip-card-errors');
|
var errorElement = document.getElementById('noticeslip-card-errors');
|
||||||
errorElement.textContent = result.error.message;
|
errorElement.textContent = result.error.message;
|
||||||
} else {
|
} else {
|
||||||
@ -211,7 +211,7 @@ function submitNoticeSlip() {
|
|||||||
amount: $("#noticeslip-pay-amount").text(),
|
amount: $("#noticeslip-pay-amount").text(),
|
||||||
stripeid: result.paymentMethod.id
|
stripeid: result.paymentMethod.id
|
||||||
}, function (resp) {
|
}, function (resp) {
|
||||||
app.preloader.hide();
|
app.dialog.close();
|
||||||
if (resp.status == "OK") {
|
if (resp.status == "OK") {
|
||||||
app.popup.close();
|
app.popup.close();
|
||||||
router.navigate("/noticeslip/success");
|
router.navigate("/noticeslip/success");
|
||||||
@ -221,7 +221,7 @@ function submitNoticeSlip() {
|
|||||||
app.dialog.alert("There was a server problem. Try again later.", "Error");
|
app.dialog.alert("There was a server problem. Try again later.", "Error");
|
||||||
}
|
}
|
||||||
}, function (xhr) {
|
}, function (xhr) {
|
||||||
app.preloader.hide();
|
app.dialog.close();
|
||||||
app.popup.close();
|
app.popup.close();
|
||||||
try {
|
try {
|
||||||
var error = $.parseJSON(xhr.responseText);
|
var error = $.parseJSON(xhr.responseText);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user