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

Commit ca3c393

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

js/widgets/forms/select.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//>>css.structure: ../css/structure/jquery.mobile.forms.select.css
66
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
77

8-
define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "../../jquery.mobile.zoom" ], function( $ ) {
8+
define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "../../jquery.mobile.zoom", "./reset" ], function( $ ) {
99
//>>excludeEnd("jqmBuildExclude");
1010
(function( $, undefined ) {
1111

@@ -141,6 +141,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
141141
self.refresh();
142142
});
143143

144+
if ( this._handleFormReset ) {
145+
this._handleFormReset();
146+
}
144147
this.build();
145148
},
146149

@@ -231,6 +234,10 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
231234
}
232235
},
233236

237+
_reset: function() {
238+
this.refresh();
239+
},
240+
234241
refresh: function() {
235242
this.setButtonText();
236243
this.setButtonCount();
@@ -252,6 +259,8 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
252259
}
253260
});
254261

262+
$.widget( "mobile.selectmenu", $.mobile.selectmenu, $.mobile.behaviors.formReset );
263+
255264
//auto self-init widgets
256265
$( document ).bind( "pagecreate create", function( e ) {
257266
$.mobile.selectmenu.prototype.enhanceWithin( e.target, true );

0 commit comments

Comments
 (0)