woocommerce/assets/js/admin/wc-status-widget.js

33 lines
737 B
JavaScript
Raw Normal View History

/*global jQuery */
(function( $ ) {
2021-02-18 23:02:35 +00:00
var recordEvent = function( link ) {
window.wcTracks.recordEvent( 'status_widget_click', {
link: link
} );
};
2021-02-18 23:02:35 +00:00
$( '.sales-this-month a' ).on( 'click', function() {
recordEvent( 'net-sales' );
});
$( '.best-seller-this-month a' ).on( 'click', function() {
recordEvent( 'best-seller-this-month' );
});
2021-02-18 23:02:35 +00:00
$( '.processing-orders a' ).on( 'click', function() {
recordEvent( 'orders-processing' );
});
2021-02-18 23:02:35 +00:00
$( '.on-hold-orders a' ).on( 'click', function() {
recordEvent( 'orders-on-hold' );
});
2021-02-18 23:02:35 +00:00
$( '.low-in-stock a' ).on( 'click', function() {
recordEvent( 'low-stock' );
});
2021-02-18 23:02:35 +00:00
$( '.out-of-stock a' ).on( 'click', function() {
recordEvent( 'out-of-stock' );
});
})( jQuery );