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

Commit

Permalink
[checkboxradio] Adding new behaviour to widget definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Oct 23, 2012
1 parent 0f212b3 commit 0de97f3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/widgets/forms/checkboxradio.js
Expand Up @@ -9,7 +9,7 @@
//>>css.structure: ../css/structure/jquery.mobile.forms.checkboxradio.css
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css

define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup" ], function( $ ) {
define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "./reset" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

Expand Down Expand Up @@ -138,6 +138,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
}
});

if ( this._handleFormReset ) {
this._handleFormReset();
}
this.refresh();
},

Expand Down Expand Up @@ -170,6 +173,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
.checkboxradio( "refresh" );
},

_reset: function() {
this.refresh();
},

refresh: function() {
var input = this.element[0],
label = this.label,
Expand Down Expand Up @@ -199,6 +206,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
}
});

$.widget( "mobile.checkboxradio", $.mobile.checkboxradio, $.mobile.behaviors.formReset );

//auto self-init widgets
$( document ).bind( "pagecreate create", function( e ) {
$.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
Expand Down

0 comments on commit 0de97f3

Please sign in to comment.