X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fmediawiki.special%2Fmediawiki.special.recentchanges.js;h=7e284fbd027bf1c91900f4325203f5ad5bbe4638;hb=637725981fffad89e2da23c58ea43ee01a07dbd6;hp=4854ff4abfc015bb3672d4014ea85d89fadfc0e6;hpb=ab52899b1d0c3d145a659dff673b80b345bb6058;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/mediawiki.special/mediawiki.special.recentchanges.js b/resources/mediawiki.special/mediawiki.special.recentchanges.js index 4854ff4abf..7e284fbd02 100644 --- a/resources/mediawiki.special/mediawiki.special.recentchanges.js +++ b/resources/mediawiki.special/mediawiki.special.recentchanges.js @@ -15,8 +15,8 @@ * special 'all' namespace is selected/unselected respectively. */ updateCheckboxes: function() { - // The 'all' namespace is the FIRST in the list. - var isAllNS = $select.find( 'option' ).first().is( ':selected' ); + // The option element for the 'all' namespace has an empty value + var isAllNS = ('' === $select.find('option:selected').val() ); // Iterates over checkboxes and propagate the selected option $.each( checkboxes, function( i, id ) { @@ -25,11 +25,11 @@ }, init: function() { - // Populate & bind - $select = $( '#namespace' ).change( rc.updateCheckboxes ); + // Populate + $select = $( '#namespace' ); - // Trigger once set the initial statuses of the checkboxes. - $select.change(); + // Bind to change event, and trigger once to set the initial state of the checkboxes. + $select.change( rc.updateCheckboxes ).change(); } };