mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Move add payment method handler outside loadScript
This commit is contained in:
parent
bc8f09decc
commit
e93c81d57b
1 changed files with 3 additions and 5 deletions
|
@ -24,7 +24,9 @@ const init = () => {
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
'DOMContentLoaded',
|
'DOMContentLoaded',
|
||||||
() => {
|
() => {
|
||||||
init();
|
jQuery(document.body).on('click init_add_payment_method', '.payment_methods input.input-radio', function () {
|
||||||
|
init()
|
||||||
|
});
|
||||||
|
|
||||||
loadScript({
|
loadScript({
|
||||||
clientId: ppcp_add_payment_method.client_id,
|
clientId: ppcp_add_payment_method.client_id,
|
||||||
|
@ -172,10 +174,6 @@ document.addEventListener(
|
||||||
console.error(error)
|
console.error(error)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery(document.body).on('click init_add_payment_method', '.payment_methods input.input-radio', function () {
|
|
||||||
init()
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue