Permalink
Browse files

[select] Adding new behaviour to widget definition

  • Loading branch information...
gabrielschulhof committed Oct 23, 2012
1 parent 0de97f3 commit ca3c3931b4d09b95a247d0b56b6757742917e818
Showing with 10 additions and 1 deletion.
  1. +10 −1 js/widgets/forms/select.js
View
@@ -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 );

0 comments on commit ca3c393

Please sign in to comment.