mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Merge branch 'fcheslack-footer-control-group-buttons'
This commit is contained in:
commit
bda2358e6c
3 changed files with 54 additions and 1 deletions
|
|
@ -142,7 +142,7 @@ var attachEvents = function() {
|
|||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ){
|
||||
|
||||
$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a", e.target )
|
||||
$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
|
||||
.not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
|
||||
.buttonMarkup();
|
||||
});
|
||||
|
|
|
|||
18
tests/unit/buttonMarkup/buttonMarkup_core.js
Normal file
18
tests/unit/buttonMarkup/buttonMarkup_core.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* mobile buttonMarkup tests
|
||||
*/
|
||||
(function($){
|
||||
module("jquery.mobile.buttonMarkup.js");
|
||||
|
||||
test( "control group buttons should be enhanced inside a footer", function(){
|
||||
var group, linkCount;
|
||||
|
||||
group = $("#control-group-footer");
|
||||
linkCount = group.find( "a" ).length;
|
||||
|
||||
same( group.find("a.ui-btn").length, linkCount, "all 4 links should be buttons");
|
||||
same( group.find("a > span.ui-corner-left").length, 1, "only 1 left cornered button");
|
||||
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");
|
||||
});
|
||||
})(jQuery);
|
||||
35
tests/unit/buttonMarkup/index.html
Normal file
35
tests/unit/buttonMarkup/index.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery Mobile Button Markup Test Suite</title>
|
||||
<!-- meta viewport left out on purpose for test append -->
|
||||
<script src="../../../js/jquery.js"></script>
|
||||
<script src="../../../js/"></script>
|
||||
<script src="../../../external/qunit.js"></script>
|
||||
<script src="../../jquery.testHelper.js"></script>
|
||||
<script src="buttonMarkup_core.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../themes/default" />
|
||||
<link rel="stylesheet" href="../../../external/qunit.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="qunit-header">jQuery Mobile Button Markup Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests">
|
||||
</ol>
|
||||
|
||||
<div data-nstest-role="page" id="default">
|
||||
<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>
|
||||
<a href="index.html" data-icon="plus">Add</a>
|
||||
<a href="index.html" data-icon="arrow-u">Up</a>
|
||||
<a href="index.html" data-icon="arrow-d">Down</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue