Permalink
Browse files

Merge pull request #5655 from jquery/fix-buttonMarkup

buttonMarkup: Do not allow a value of null to end up the value of an ...
  • Loading branch information...
2 parents d1c3245 + 675e0dc commit 3cf5d18127f2a6cd7e5b478d59cf2b5354ba3d15 @gabrielschulhof gabrielschulhof committed Feb 20, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/jquery.mobile.buttonMarkup.js
@@ -52,7 +52,11 @@ $.fn.buttonMarkup = function( options ) {
buttonElements;
for ( key in o ) {
- e.setAttribute( nsKey + key, o[ key ] );
+ if ( o[ key ] === undefined || o[ key ] === null ) {
+ el.removeAttr( nsKey + key );
+ } else {
+ e.setAttribute( nsKey + key, o[ key ] );
+ }
}
if ( getAttrFixed( e, nsKey + "rel" ) === "popup" && el.attr( "href" ) ) {

0 comments on commit 3cf5d18

Please sign in to comment.