mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Improvement of fix spacing when switching ApplePay payment method in checkout page.
This commit is contained in:
parent
db997e934e
commit
c8ee62892a
1 changed files with 4 additions and 5 deletions
|
@ -140,17 +140,16 @@ class ApplepayButton {
|
|||
const wrapper_id = '#' + wrapper;
|
||||
|
||||
const syncButtonVisibility = () => {
|
||||
if (!this.isEligible) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $ppcpButtonWrapper = jQuery(ppcpButtonWrapper);
|
||||
setVisible(wrapper_id, $ppcpButtonWrapper.is(':visible'));
|
||||
setEnabled(wrapper_id, !$ppcpButtonWrapper.hasClass('ppcp-disabled'));
|
||||
}
|
||||
|
||||
jQuery(document).on('ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled', (ev, data) => {
|
||||
if (!this.isEligible) {
|
||||
setVisible(wrapper_id, false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (jQuery(data.selector).is(ppcpButtonWrapper)) {
|
||||
syncButtonVisibility();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue