"Catrope" changed the status of MediaWiki.r108275 to "ok" and commented it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/108275#c29269
Old Status: new
> New Status: ok
Commit summary for MediaWiki.r108275:
only allow one secondary checkbox to be checked at one time due them cancelling
each other out
Catrope's comment:
<pre>
+ var count = $( 'input[type=checkbox].fbd-filters-check').length;
+ if(count > 1) {
</pre>
Does this work properly? It seems to rely on the state of the checkbox to have
switched to 'checked' prior to the click handler being executed. It would be
simpler to just unconditionally uncheck all checkboxes except 'this', like so:
<pre>
$( 'input[type=checkbox].fbd-filters-check' ).click( function() {
$( 'input[type=checkbox].fbd-filters-check' ).not( this ).prop(
'checked', false );
} );
</pre>
then it doesn't matter when the checkbox changes state, and you're not trying
to set checked to true while the browser will already do that for you.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview