2 * JavaScript for Special:RecentChanges
5 var rc
, $checkboxes
, $select
, namespaceDropdown
;
8 * @class mw.special.recentchanges
13 * Handler to hide/show the namespace selector checkboxes when the
14 * special 'all' namespace is selected/unselected respectively.
16 updateCheckboxes: function () {
17 // The option element for the 'all' namespace has an empty value
18 var value
= $select
.val(),
19 isAllNS
= value
=== 'all' || value
=== '';
21 // Iterates over checkboxes and propagate the selected option
22 $checkboxes
.toggleClass( 'mw-input-hidden', isAllNS
);
26 $select
= $( 'select#namespace' );
27 $checkboxes
= $( '#nsassociated, #nsinvert, .contribs-ns-filters' )
28 .closest( '.mw-input-with-label' );
30 if ( $select
.length
=== 0 ) {
31 $select
= $( '#namespace select' );
32 if ( $select
.length
> 0 ) {
33 namespaceDropdown
= OO
.ui
.infuse( $( '#namespace' ).closest( '[data-ooui]' ) );
34 namespaceDropdown
.on( 'change', rc
.updateCheckboxes
);
37 // Bind to change event of the checkboxes.
38 // The initial state is already set in HTML.
39 $select
.on( 'change', rc
.updateCheckboxes
);