PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.4
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.4
3.4.4 3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 All 197 releases
← All changes | resources/backend/js/wp-list-table-buttons.js +17 -22 2.2.0 → 3.4.4 View file →
@@ -1,31 +1,26 @@
1 1 /**
2 2 * Moves any buttons added from the filter list in a WP_List_Table
3 3 * to be displayed next to the "Add New" button.
4 4 *
5 - * @package ConvertKit
6 5 * @author ConvertKit
7 6 */
8 7
9 -jQuery( document ).ready(
10 - function( $ ) {
8 +document.addEventListener('DOMContentLoaded', function () {
9 + // Move any buttons from the filter list to display next to the Add New button.
10 + document.querySelectorAll('ul.subsubsub span').forEach(function (span) {
11 + // Ignore if not a ConvertKit Group Action.
12 + if (!span.classList.contains('convertkit-action')) {
13 + return;
14 + }
11 15
12 - // Move any buttons from the filter list to display next to the Add New button.
13 - $( 'ul.subsubsub a' ).each(
14 - function() {
16 + // Clone and move.
17 + const clone = span.cloneNode(true);
18 + clone.classList.remove('hidden');
19 + document
20 + .querySelector('a.page-title-action')
21 + .insertAdjacentElement('afterend', clone);
15 22
16 - // Ignore if not a ConvertKit Group Action.
17 - if ( ! $( this ).hasClass( 'convertkit-action' ) ) {
18 - return;
19 - }
20 -
21 - // Move.
22 - $( this ).clone().removeClass( 'hidden' ).insertAfter( 'a.page-title-action' );
23 -
24 - // Remove original.
25 - $( this ).parent().remove();
26 -
27 - }
28 - );
29 -
30 - }
31 -);
23 + // Remove original.
24 + span.parentElement.remove();
25 + });
26 +});