diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 4bb9e11f..050d33cc 100644 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -13,7 +13,10 @@ $.fn.buttonMarkup = function( options ) { icon: el.jqmData( "icon" ), iconpos: el.jqmData( "iconpos" ), theme: el.jqmData( "theme" ), - inline: el.jqmData( "inline" ) + inline: el.jqmData( "inline" ), + shadow: el.jqmData( "shadow" ), + corners: el.jqmData( "corners" ), + iconshadow: el.jqmData( "iconshadow" ) }, options ), // Classes Defined diff --git a/tests/unit/buttonMarkup/buttonMarkup_core.js b/tests/unit/buttonMarkup/buttonMarkup_core.js index 88f36565..58aba0ea 100644 --- a/tests/unit/buttonMarkup/buttonMarkup_core.js +++ b/tests/unit/buttonMarkup/buttonMarkup_core.js @@ -15,4 +15,15 @@ same( group.find("a > span.ui-corner-right").length, 1, "only 1 right cornered button"); same( group.find("a > span:not(.ui-corner-left):not(.ui-corner-right)").length, linkCount - 2, "only 2 buttons are cornered"); }); + + test( "control group buttons should respect theme-related data attributes", function(){ + var group = $("#control-group-content"); + + ok(!group.find('[data-shadow=false]').hasClass("ui-shadow"), + "buttons with data-shadow=false should not have the ui-shadow class"); + ok(!group.find('[data-corners=false]').hasClass("ui-btn-corner-all"), + "buttons with data-corners=false should not have the ui-btn-corner-all class"); + ok(!group.find('[data-iconshadow=false] .ui-icon').hasClass("ui-icon-shadow"), + "buttons with data-iconshadow=false should not have the ui-icon-shadow class on their icons"); + }); })(jQuery); diff --git a/tests/unit/buttonMarkup/index.html b/tests/unit/buttonMarkup/index.html index e3108a1e..20946213 100644 --- a/tests/unit/buttonMarkup/index.html +++ b/tests/unit/buttonMarkup/index.html @@ -24,6 +24,13 @@