fixed button initialization for regular role=button buttons so they can be used in controlgroups.

This commit is contained in:
scottjehl 2010-10-11 17:48:03 -04:00
parent b4c3f4b29f
commit 0f40e2d28a

View file

@ -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" );