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

Commit

Permalink
Select: Remove class ui-btn-left/right from the select element itself…
Browse files Browse the repository at this point in the history
… during enhancement. Fixes #5073
  • Loading branch information
jaspermdegroot committed Jan 3, 2013
1 parent f33b4bc commit 85fd672
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/widgets/forms/select.js
Expand Up @@ -60,14 +60,14 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
classes = $el[0].className;
} */
if ( !!~this.element[0].className.indexOf( "ui-btn-left" ) ) {
classes = " ui-btn-left";
classes = " ui-btn-left";
}

if ( !!~this.element[0].className.indexOf( "ui-btn-right" ) ) {
classes = " ui-btn-right";
}

this.select = this.element.wrap( "<div class='ui-select" + classes + "'>" );
this.select = this.element.removeClass( "ui-btn-left ui-btn-right" ).wrap( "<div class='ui-select" + classes + "'>" );
this.selectID = this.select.attr( "id" );
this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
this.isMultiple = this.select[ 0 ].multiple;
Expand All @@ -79,6 +79,9 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
_destroy: function() {
var wrapper = this.element.parents( ".ui-select" );
if ( wrapper.length > 0 ) {
if ( wrapper.is( ".ui-btn-left, .ui-btn-right" ) ) {
this.element.addClass( wrapper.is( ".ui-btn-left" ) ? "ui-btn-left" : "ui-btn-right" );
}
this.element.insertAfter( wrapper );
wrapper.remove();
}
Expand Down

0 comments on commit 85fd672

Please sign in to comment.