🔥 Remove unused getter

This commit is contained in:
Philipp Stracker 2024-08-12 18:51:37 +02:00
parent 966b76102c
commit 5a870de4f4
No known key found for this signature in database

View file

@ -552,36 +552,6 @@ export default class PaymentButton {
return this.wrapperElement instanceof HTMLElement;
}
/**
* Returns an array of HTMLElements that belong to the payment button.
*
* @readonly
* @return {HTMLElement[]} List of payment button wrapper elements.
*/
get allElements() {
const selectors = [];
// Payment button (Pay now, smart button block)
selectors.push( `#${ this.wrapperId }` );
// Block Checkout: Express checkout button.
if ( PaymentContext.Blocks.includes( this.context ) ) {
selectors.push( `#${ this.wrappers.Block }` );
}
// Classic Checkout: Separate gateway.
if ( this.isSeparateGateway ) {
selectors.push(
`.wc_payment_method.payment_method_${ this.methodId }`
);
}
this.log( 'Wrapper Elements:', selectors );
return /** @type {HTMLElement[]} */ selectors.flatMap( ( selector ) =>
Array.from( document.querySelectorAll( selector ) )
);
}
/**
* Checks, if the payment button is still attached to the DOM.
*