Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Select: Remove class ui-btn-left/right from the select element itself…

… during enhancement. Fixes #5073
  • Loading branch information...
commit 85fd6722be45b8685cfd1951068bdea843dc21c7 1 parent f33b4bc
@jaspermdegroot jaspermdegroot authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 js/widgets/forms/select.js
View
7 js/widgets/forms/select.js
@@ -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;
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.