|
9 | 9 | //>>css.structure: ../css/structure/jquery.mobile.forms.checkboxradio.css |
10 | 10 | //>>css.theme: ../css/themes/default/jquery.mobile.theme.css |
11 | 11 |
|
12 | | -define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup" ], function( $ ) { |
| 12 | +define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "./reset" ], function( $ ) { |
13 | 13 | //>>excludeEnd("jqmBuildExclude"); |
14 | 14 | (function( $, undefined ) { |
15 | 15 |
|
@@ -138,6 +138,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { |
138 | 138 | } |
139 | 139 | }); |
140 | 140 |
|
| 141 | + if ( this._handleFormReset ) { |
| 142 | + this._handleFormReset(); |
| 143 | + } |
141 | 144 | this.refresh(); |
142 | 145 | }, |
143 | 146 |
|
@@ -170,6 +173,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { |
170 | 173 | .checkboxradio( "refresh" ); |
171 | 174 | }, |
172 | 175 |
|
| 176 | + _reset: function() { |
| 177 | + this.refresh(); |
| 178 | + }, |
| 179 | + |
173 | 180 | refresh: function() { |
174 | 181 | var input = this.element[0], |
175 | 182 | label = this.label, |
@@ -199,6 +206,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { |
199 | 206 | } |
200 | 207 | }); |
201 | 208 |
|
| 209 | +$.widget( "mobile.checkboxradio", $.mobile.checkboxradio, $.mobile.behaviors.formReset ); |
| 210 | + |
202 | 211 | //auto self-init widgets |
203 | 212 | $( document ).bind( "pagecreate create", function( e ) { |
204 | 213 | $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true ); |
|
0 commit comments