woocommerce/plugins/woocommerce-admin/client/wp-admin-scripts/woo-enable-autorenew/index.js

21 lines
521 B
JavaScript

/**
* External dependencies
*/
import domReady from '@wordpress/dom-ready';
import { recordEvent } from '@woocommerce/tracks';
domReady( () => {
const enableAutorenewLink = document.querySelectorAll(
'.woocommerce-enable-autorenew'
);
if ( enableAutorenewLink.length > 0 ) {
recordEvent( 'woo_enable_autorenew_in_plugins_shown' );
enableAutorenewLink.forEach( ( link ) => {
link.addEventListener( 'click', function () {
recordEvent( 'woo_enable_autorenew_in_plugins_clicked' );
} );
} );
}
} );