Skip to content

Commit

Permalink
Merge pull request #1665 from xwp/fix/1661-select-all-alerts-in-table…
Browse files Browse the repository at this point in the history
…-view-not-working

Add custom JS to fix select all toggle on alerts list
  • Loading branch information
marcinkrzeminski authored Jan 10, 2025
2 parents 5e5ca83 + a327668 commit ac9aa3e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ui/js/alerts-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* globals jQuery */
( function( $ ) {
$( document ).ready(
function() {
$( '.inline-edit-col-left, .inline-edit-col-right, #major-publishing-actions', '.edit-php.post-type-wp_stream_alerts' ).each(
function() {
$( this ).remove();
}
);

// This is done with JS instead of CSS to override the inline styles added by Select2's JS.
$( '.select2-container', '.inline-edit-col' ).css( { width: '100%' } );

// Re-enable the select all functionality
$( '.wp-list-table thead .check-column input[type="checkbox"]' ).on(
'click',
function() {
$( this )
.parents( '.wp-list-table' )
.find( 'tbody .check-column input[type="checkbox"]' )
.click();
}
);
}
);
}( jQuery ) );

0 comments on commit ac9aa3e

Please sign in to comment.