Fire a change event on the checkboxes when selecting All/None/Invert

Fire a change event through JQuery when the user selects one of
All / Invert / None when using the list toggle provided in
ListToggle.php so that any JS that listens for a change event on
the checkboxes (that would be for the user selecting or de-
selecting checkboxes) gets a change event.

This is needed because CheckUser's caMultiLock.js script listens
for change events on the checkboxes in the 'Get edits' results
to update the URL that links to the MultiLock special page.

Bug: T311924
Change-Id: I76af8f2bbd6707dacef9872bb5a737823fc3d0af
This commit is contained in:
dreamyjazz 2022-07-02 20:21:01 +01:00
parent fc9afe98c9
commit de9d6eb84e

View file

@ -18,7 +18,7 @@
var $checkboxes = $( 'li input[type="checkbox"]' );
function selectAll( check ) {
$checkboxes.prop( 'checked', check );
$checkboxes.prop( 'checked', check ).change();
}
$( '.mw-checkbox-all' ).on( 'click', function () {
@ -30,7 +30,7 @@
$( '.mw-checkbox-invert' ).on( 'click', function () {
$checkboxes.prop( 'checked', function ( i, val ) {
return !val;
} );
} ).change();
} );
} );