Skip to content

Commit 874011e

Browse files
committed
Checkboxradio: Typos and minor style fixes
1 parent add7844 commit 874011e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

ui/widgets/checkboxradio.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
1313
//>>docs: http://api.jqueryui.com/checkboxradio/
1414
//>>demos: http://jqueryui.com/checkboxradio/
15-
//>>css.structure: ../themes/base/core.css, ../themes/base/button.css, ../themes/base/checkboxradio.css
15+
//>>css.structure: ../themes/base/core.css
16+
//>>css.structure: ../themes/base/button.css
17+
//>>css.structure: ../themes/base/checkboxradio.css
1618
//>>css.theme: ../themes/base/theme.css
1719

1820
( function( factory ) {
@@ -46,9 +48,9 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
4648
},
4749

4850
_getCreateOptions: function() {
49-
var disabled, labels,
50-
that = this,
51-
options = this._super() || {};
51+
var disabled, labels;
52+
var that = this;
53+
var options = this._super() || {};
5254

5355
// We read the type here, because it makes more sense to throw a element type error first,
5456
// rather then the error for lack of a label. Often if its the wrong type, it
@@ -152,14 +154,13 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
152154
var formParent = this.formParent[ 0 ];
153155
var radios = $( [] );
154156

155-
if ( name ) {
156-
name = $.ui.escapeSelector( name );
157-
radios = this.formParent.find( "[name='" + $.ui.escapeSelector( name ) + "']" ).filter( function() {
158-
var form = $( this ).form();
159-
return ( form.length ? form : $( "body" ) )[ 0 ] === formParent;
160-
} );
161-
}
162-
return radios.not( this.element );
157+
if ( !name ) {
158+
return $( [] );
159+
}``
160+
return this.formParent.find( "[name='" + $.ui.escapeSelector( name ) + "']" ).filter( function() {
161+
var form = $( this ).form();
162+
return ( form.length ? form : $( "body" ) )[ 0 ] === formParent;
163+
} ).not( this.element );
163164
},
164165

165166
_toggleClasses: function() {
@@ -207,7 +208,7 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
207208
this._toggleClass( this.label, null, "ui-state-disabled", value );
208209
this.element[ 0 ].disabled = value;
209210

210-
// Don't refresh if disabled
211+
// Don't refresh when setting disabled
211212
return;
212213
}
213214
this.refresh();

0 commit comments

Comments
 (0)