diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 59f9d94e..438a1da6 100644 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -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(); }); diff --git a/tests/unit/buttonMarkup/buttonMarkup_core.js b/tests/unit/buttonMarkup/buttonMarkup_core.js new file mode 100644 index 00000000..5e7d6657 --- /dev/null +++ b/tests/unit/buttonMarkup/buttonMarkup_core.js @@ -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); \ No newline at end of file diff --git a/tests/unit/buttonMarkup/index.html b/tests/unit/buttonMarkup/index.html new file mode 100644 index 00000000..68d8592e --- /dev/null +++ b/tests/unit/buttonMarkup/index.html @@ -0,0 +1,35 @@ + + +
+ +