X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.special.recentchanges.js;h=310832defb8419bed5c7c39da26f21791046531f;hb=7612ebe9ca00892bdf73e7ad74a3ca2e11e6f590;hp=29c0feaf17f6a7208adf24ab60656c739f9e8045;hpb=b4054da0f9c2a1c23f4af93871329e39c0ab6a8f;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.special.recentchanges.js b/resources/src/mediawiki.special.recentchanges.js index 29c0feaf17..310832defb 100644 --- a/resources/src/mediawiki.special.recentchanges.js +++ b/resources/src/mediawiki.special.recentchanges.js @@ -1,7 +1,7 @@ /*! * JavaScript for Special:RecentChanges */ -( function ( mw, $ ) { +( function () { var rc, $checkboxes, $select; /** @@ -10,7 +10,7 @@ */ rc = { /** - * Handler to disable/enable the namespace selector checkboxes when the + * Handler to hide/show the namespace selector checkboxes when the * special 'all' namespace is selected/unselected respectively. */ updateCheckboxes: function () { @@ -18,16 +18,16 @@ var isAllNS = $select.val() === ''; // Iterates over checkboxes and propagate the selected option - $checkboxes.prop( 'disabled', isAllNS ); + $checkboxes.toggleClass( 'mw-input-hidden', isAllNS ); }, init: function () { $select = $( '#namespace' ); - $checkboxes = $( '#nsassociated, #nsinvert' ); + $checkboxes = $( '#nsassociated, #nsinvert' ).closest( '.mw-input-with-label' ); - // Bind to change event, and trigger once to set the initial state of the checkboxes. - rc.updateCheckboxes(); - $select.change( rc.updateCheckboxes ); + // Bind to change event of the checkboxes. + // The initial state is already set in HTML. + $select.on( 'change', rc.updateCheckboxes ); } }; @@ -35,4 +35,4 @@ module.exports = rc; -}( mediaWiki, jQuery ) ); +}() );