Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[select] Adding new behaviour to widget definition

  • Loading branch information...
commit ca3c3931b4d09b95a247d0b56b6757742917e818 1 parent 0de97f3
@gabrielschulhof gabrielschulhof authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 js/widgets/forms/select.js
View
11 js/widgets/forms/select.js
@@ -5,7 +5,7 @@
//>>css.structure: ../css/structure/jquery.mobile.forms.select.css
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
-define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "../../jquery.mobile.zoom" ], function( $ ) {
+define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", "../../jquery.mobile.buttonMarkup", "../../jquery.mobile.zoom", "./reset" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
@@ -141,6 +141,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
self.refresh();
});
+ if ( this._handleFormReset ) {
+ this._handleFormReset();
+ }
this.build();
},
@@ -231,6 +234,10 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}
},
+ _reset: function() {
+ this.refresh();
+ },
+
refresh: function() {
this.setButtonText();
this.setButtonCount();
@@ -252,6 +259,8 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}
});
+$.widget( "mobile.selectmenu", $.mobile.selectmenu, $.mobile.behaviors.formReset );
+
//auto self-init widgets
$( document ).bind( "pagecreate create", function( e ) {
$.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
Please sign in to comment.
Something went wrong with that request. Please try again.