From 0f40e2d28a88fb9b4985e01a2f1805ca39384e4a Mon Sep 17 00:00:00 2001 From: scottjehl Date: Mon, 11 Oct 2010 17:48:03 -0400 Subject: [PATCH] fixed button initialization for regular role=button buttons so they can be used in controlgroups. --- js/jquery.mobile.page.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/js/jquery.mobile.page.js b/js/jquery.mobile.page.js index 9636186c..1d29957b 100644 --- a/js/jquery.mobile.page.js +++ b/js/jquery.mobile.page.js @@ -18,8 +18,10 @@ $.widget( "mobile.page", $.mobile.widget, { this.element.find( "[data-role=nojs]" ).addClass( "ui-nojs" ); this._enchanceControls(); + + //links in bars, or those with data-role become buttons + this.element.find( "[data-role=button], .ui-bar a" ).not( ".ui-btn" ).buttonMarkup(); - //pre-find data els var $dataEls = this.element.find( "[data-role]" ).andSelf().each(function() { var $this = $( this ), role = $this.data( "role" ), @@ -62,7 +64,7 @@ $.widget( "mobile.page", $.mobile.widget, { .prependTo( $this ); } - $headeranchors.buttonMarkup(); + $this.children( "a" ).buttonMarkup(); //page title $this.children( ":header" ) @@ -103,13 +105,6 @@ $.widget( "mobile.page", $.mobile.widget, { } }); - //links in bars, or those with data-role become buttons - $dataEls //MOVETO LINE - .filter( "[data-role=button]" ) - .add( ".ui-bar a, .ui-footer a, .ui-header a") - .not( ".ui-btn" ) - .buttonMarkup(); - //links within content areas this.element.find( ".ui-body a:not(.ui-btn):not(.ui-link-inherit)" ) .addClass( "ui-link" );