This is done by looking for an <option> element with an empty string value
which denote the special case 'all'.
Also removed a comment in Xml.php asking to keep 'all' as a first element
since it is no longer needed.
Follow up r90943 (comment 18872 by Brion)
}
if( !is_null( $all ) )
- # Please make sure the 'namespacesall' is the first or you will break
- # such an assumption (ex js: mw.special.recentchanges.updateCheckboxes)
$namespaces = array( $all => wfMsg( 'namespacesall' ) ) + $namespaces;
foreach( $namespaces as $index => $name ) {
if( $index < NS_MAIN ) {
* 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 ) {