Merge "Removed useless JobQueue return values"
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.recentchanges.js
1 /**
2 * JavaScript for Special:RecentChanges
3 */
4 ( function ( mw, $ ) {
5 var rc, $checkboxes, $select;
6
7 rc = {
8 /**
9 * Handler to disable/enable the namespace selector checkboxes when the
10 * special 'all' namespace is selected/unselected respectively.
11 */
12 updateCheckboxes: function () {
13 // The option element for the 'all' namespace has an empty value
14 var isAllNS = $select.val() === '';
15
16 // Iterates over checkboxes and propagate the selected option
17 $checkboxes.prop( 'disabled', isAllNS );
18 },
19
20 init: function () {
21 $select = $( '#namespace' );
22 $checkboxes = $( '#nsassociated, #nsinvert' );
23
24 // Bind to change event, and trigger once to set the initial state of the checkboxes.
25 rc.updateCheckboxes();
26 $select.change( rc.updateCheckboxes );
27 }
28 };
29
30 $( rc.init );
31
32 mw.special.recentchanges = rc;
33
34 }( mediaWiki, jQuery ) );