Permalink
Browse files

[buttonMarkup] Do not assume that a button's className will contain o…

…nly classes assigned by buttonMarkup()
  • Loading branch information...
1 parent bb49223 commit 268b9e928dca48325a69bb7383a3a08198525256 @gabrielschulhof gabrielschulhof committed Nov 5, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 js/jquery.mobile.buttonMarkup.js
@@ -233,7 +233,10 @@ function updateButtonClass( $btn, classToRemove, classToAdd, hover, state ) {
var buttonElements = $.data( $btn[ 0 ], "buttonElements" );
$btn.removeClass( classToRemove ).addClass( classToAdd );
if ( buttonElements ) {
- buttonElements.bcls = $btn[ 0 ].className;
+ buttonElements.bcls = $( document.createElement( "div" ) )
+ .addClass( buttonElements.bcls + " " + classToAdd )
+ .removeClass( classToRemove )
+ .attr( "class" );
if ( hover !== undefined ) {
buttonElements.hover = hover;
}

0 comments on commit 268b9e9

Please sign in to comment.