5 (function( $, undefined ) {
7 $.widget( "mobile.navbar", $.mobile.widget, {
11 initSelector: ":jqmData(role='navbar')"
16 var $navbar = this.element,
17 $navbtns = $navbar.find( "a" ),
18 iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
19 this.options.iconpos : undefined;
21 $navbar.addClass( "ui-navbar" )
22 .attr( "role","navigation" )
24 .grid({ grid: this.options.grid });
27 $navbar.addClass( "ui-navbar-noicons" );
30 $navbtns.buttonMarkup({
36 $navbar.delegate( "a", "vclick", function( event ) {
37 $navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
38 $( this ).addClass( $.mobile.activeBtnClass );
43 //auto self-init widgets
44 $( document ).bind( "pagecreate create", function( e ){
45 $( $.mobile.navbar.prototype.options.initSelector, e.target ).navbar();