Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 0de97f3

Browse files
author
Gabriel Schulhof
committed
[checkboxradio] Adding new behaviour to widget definition
1 parent 0f212b3 commit 0de97f3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

js/widgets/forms/checkboxradio.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//>>css.structure: ../css/structure/jquery.mobile.forms.checkboxradio.css
1010
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
1111

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( $ ) {
1313
//>>excludeEnd("jqmBuildExclude");
1414
(function( $, undefined ) {
1515

@@ -138,6 +138,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
138138
}
139139
});
140140

141+
if ( this._handleFormReset ) {
142+
this._handleFormReset();
143+
}
141144
this.refresh();
142145
},
143146

@@ -170,6 +173,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
170173
.checkboxradio( "refresh" );
171174
},
172175

176+
_reset: function() {
177+
this.refresh();
178+
},
179+
173180
refresh: function() {
174181
var input = this.element[0],
175182
label = this.label,
@@ -199,6 +206,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
199206
}
200207
});
201208

209+
$.widget( "mobile.checkboxradio", $.mobile.checkboxradio, $.mobile.behaviors.formReset );
210+
202211
//auto self-init widgets
203212
$( document ).bind( "pagecreate create", function( e ) {
204213
$.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );

0 commit comments

Comments
 (0)