fix label class application bug

This commit is contained in:
John Bender 2011-08-09 15:50:42 -07:00
parent 88edbc666f
commit 62e1631353
2 changed files with 4 additions and 2 deletions

View file

@ -395,8 +395,8 @@
var extensionAttributes = function(){
var widget = this,
select = this.select,
selectID = this.select.attr( "id" ),
label = $( "label[for='"+ selectID +"']" ).addClass( "ui-select" ),
selectID = this.selectID,
label = this.label,
thisPage = this.select.closest( ".ui-page" ),
screen = $( "<div>", {"class": "ui-selectmenu-screen ui-screen-hidden"} ).appendTo( thisPage ),
selectOptions = this.select.find("option"),

View file

@ -79,6 +79,8 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
// setup items that are generally necessary for select menu extension
_preExtension: function(){
this.select = this.element.wrap( "<div class='ui-select'>" );
this.selectID = this.select.attr( "id" );
this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
this.isMultiple = this.select[ 0 ].multiple;
this.options.theme = this._theme();
this.selectOptions = this.select.find( "option" );