mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Merge pull request #2714 from matthewleon/bug_2713
Bug 2713. Buttons properly support the data-shadow, data-corners and data-iconshadow attributes. Thanks matthewleon!
This commit is contained in:
commit
d7bc5184f9
3 changed files with 22 additions and 1 deletions
|
|
@ -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 @@
|
|||
</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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue