/* * jQuery Mobile Framework : "navbar" plugin * Copyright (c) jQuery Project * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. * Note: Code is in draft form and is subject to change */ (function($, undefined ) { $.widget( "mobile.navbar", $.mobile.widget, { options: { iconpos: 'top' }, _create: function(){ var $navbar = this.element, $navbtns = $navbar.find("a"), iconpos = $navbtns.filter('data-icon').length ? this.options.iconpos : undefined; $navbar .addClass('ui-navbar') .attr("role","navigation") .find("ul") .grid({grid: $navbtns.length > 2 ? "b" : "a"}); if( !iconpos ){ $navbar.addClass("ui-navbar-noicons"); } $navbtns .buttonMarkup({ corners: false, shadow: false, iconpos: iconpos }); $navbar.delegate("a", "click",function(event){ $navbtns.removeClass("ui-btn-active"); }); } }); })( jQuery );