mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Check if element exists
This commit is contained in:
parent
e3549abd8d
commit
4e949b0733
1 changed files with 4 additions and 2 deletions
|
@ -40,11 +40,13 @@ document.addEventListener( 'DOMContentLoaded', () => {
|
|||
document.addEventListener( 'click', ( event ) => {
|
||||
if (
|
||||
event.target.closest( '.button.button-settings-switch-ui' ) ||
|
||||
event.target.closest( '.ppcp-notice-wrapper:not(.inline) a.settings-switch-ui' ) ||
|
||||
event.target.closest(
|
||||
'.ppcp-notice-wrapper:not(.inline) a.settings-switch-ui'
|
||||
) ||
|
||||
event.target.closest( 'a[name="settings-switch-ui"]' ) ||
|
||||
event.target
|
||||
.closest( '.woocommerce-inbox-note__action-button' )
|
||||
.textContent.includes( 'Switch to New Settings' )
|
||||
?.textContent.includes( 'Switch to New Settings' )
|
||||
) {
|
||||
handleClick( event );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue