Permalink
Browse files

Merge pull request #2714 from matthewleon/bug_2713

Bug 2713. Buttons properly support the data-shadow, data-corners and data-iconshadow attributes. Thanks matthewleon!
  • Loading branch information...
toddparker committed Oct 16, 2011
2 parents 02b5aee + 8b713b2 commit d7bc5184f9f4847d930b9c1b430e2bc73448ec7d
@@ -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
@@ -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);
@@ -24,6 +24,13 @@ <h2 id="qunit-userAgent"></h2>
</ol>
<div data-nstest-role="page" id="default">
+ <div data-role="content" id="control-group-content">
+ <a href="index.html" data-role="button" data-shadow="false">No shadow</a>
+ <a href="index.html" data-role="button" data-corners="false">No corners</a>
+ <a href="index.html" data-role="button" data-shadow="false" data-corners="false">No shadow or corners</a>
+ <a href="index.html" data-role="button" data-icon="delete" data-iconshadow="false">No iconshadow</a>
+ <button data-shadow="false" data-corners="false" data-icon="delete" data-iconshadow="false">None of the above</button>
+ </div>
<div data-role="footer" id="control-group-footer" class="ui-bar" data-position="inline">
<div data-role="controlgroup" data-type="horizontal">
<a href="index.html" data-icon="delete">Remove</a>

1 comment on commit d7bc518

@naton

This comment has been minimized.

Show comment
Hide comment
@naton

naton Nov 17, 2011

Does this apply to the data-split-icons too?

naton commented on d7bc518 Nov 17, 2011

Does this apply to the data-split-icons too?

Please sign in to comment.