7b117595daac4d97e5b7458ad0ad633cd7c3f2a3
1 /* JavaScript for Special:RecentChanges */
4 var checkboxes
= [ 'nsassociated', 'nsinvert' ];
11 var rc
= mw
.special
.recentchanges
= {
14 * Handler to disable/enable the namespace selector checkboxes when the
15 * special 'all' namespace is selected/unselected respectively.
17 updateCheckboxes: function() {
18 // The 'all' namespace is the FIRST in the list.
19 var isAllNS
= $select
.find( 'option' ).first().is( ':selected' );
21 // Iterates over checkboxes and propagate the selected option
22 $.each( checkboxes
, function( i
, id
) {
23 $( '#' + id
).attr( 'disabled', isAllNS
);
29 $select
= $( '#namespace' );
31 // Bind to change event, and trigger once to set the initial state of the checkboxes.
32 $select
.change( rc
.updateCheckboxes
).change();
36 // Run when document is ready