mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 04:58:28 +08:00
21 lines
715 B
JavaScript
21 lines
715 B
JavaScript
;document.addEventListener(
|
|
'DOMContentLoaded',
|
|
() => {
|
|
const disabledCheckboxes = document.querySelectorAll(
|
|
'.ppcp-disabled-checkbox'
|
|
)
|
|
|
|
function disableAll(nodeList){
|
|
nodeList.forEach(node => node.setAttribute('disabled', 'true'))
|
|
}
|
|
|
|
disableAll( disabledCheckboxes )
|
|
|
|
if(PayPalCommerceGatewaySettings.is_subscriptions_plugin_active !== '1') {
|
|
const subscriptionBehaviorWhenVaultFails = document.getElementById('field-subscription_behavior_when_vault_fails');
|
|
if (subscriptionBehaviorWhenVaultFails) {
|
|
subscriptionBehaviorWhenVaultFails.style.display = 'none'
|
|
}
|
|
}
|
|
}
|
|
);
|