mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Allow set target on spinner
This commit is contained in:
parent
9bf0248153
commit
aa91751450
2 changed files with 10 additions and 2 deletions
|
@ -16,9 +16,12 @@ class CheckoutActionHandler {
|
|||
const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ?
|
||||
this.config.bn_codes[this.config.context] : '';
|
||||
|
||||
|
||||
const errorHandler = this.errorHandler;
|
||||
|
||||
const formSelector = this.config.context === 'checkout' ? 'form.checkout' : 'form#order_review';
|
||||
spinner.setTarget(formSelector);
|
||||
spinner.block();
|
||||
|
||||
const formValues = jQuery(formSelector).serialize();
|
||||
|
||||
return fetch(this.config.ajax.create_order.endpoint, {
|
||||
|
|
|
@ -3,6 +3,11 @@ class Spinner {
|
|||
constructor() {
|
||||
this.target = 'form.woocommerce-checkout';
|
||||
}
|
||||
|
||||
setTarget(target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
block() {
|
||||
|
||||
jQuery( this.target ).block({
|
||||
|
@ -20,4 +25,4 @@ class Spinner {
|
|||
}
|
||||
}
|
||||
|
||||
export default Spinner;
|
||||
export default Spinner;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue