|
12 | 12 | //>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
|
13 | 13 | //>>docs: http://api.jqueryui.com/checkboxradio/
|
14 | 14 | //>>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 |
16 | 18 | //>>css.theme: ../themes/base/theme.css
|
17 | 19 |
|
18 | 20 | ( function( factory ) {
|
@@ -46,9 +48,9 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
|
46 | 48 | },
|
47 | 49 |
|
48 | 50 | _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() || {}; |
52 | 54 |
|
53 | 55 | // We read the type here, because it makes more sense to throw a element type error first,
|
54 | 56 | // 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, {
|
152 | 154 | var formParent = this.formParent[ 0 ];
|
153 | 155 | var radios = $( [] );
|
154 | 156 |
|
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 ); |
163 | 164 | },
|
164 | 165 |
|
165 | 166 | _toggleClasses: function() {
|
@@ -207,7 +208,7 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
|
207 | 208 | this._toggleClass( this.label, null, "ui-state-disabled", value );
|
208 | 209 | this.element[ 0 ].disabled = value;
|
209 | 210 |
|
210 |
| - // Don't refresh if disabled |
| 211 | + // Don't refresh when setting disabled |
211 | 212 | return;
|
212 | 213 | }
|
213 | 214 | this.refresh();
|
|
0 commit comments