r88694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88693‎ | r88694 | r88695 >
Date:22:29, 23 May 2011
Author:dale
Status:ok
Tags:
Comment:
0 or 1 based checked attribute causes trouble with 1.6.1 checked attribute handing, use Boolean value instead
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js
@@ -153,8 +153,8 @@
154154 var _this = this;
155155 $j.each( _this.inputs, function( i, $input ) {
156156 var templateString = $input.data( 'templateString' );
157 - // !! to ensure boolean. ~~ to cast to 0 or 1. Similar to php's (int) (bool) val
158 - $input.attr( 'checked', ~~!!values[templateString] );
 157+ // !! to ensure boolean.
 158+ $input.attr( 'checked', !!values[templateString] );
159159 } );
160160 // we use the selector because events can't be unbound unless they're in the DOM.
161161 _this.$selector.trigger( 'changeLicenses' );

Status & tagging log