//>>built
define("dojox/mobile/TabBarButton","dojo/_base/connect dojo/_base/declare dojo/_base/event dojo/_base/lang dojo/dom dojo/dom-class dojo/dom-construct dojo/dom-style dojo/dom-attr ./common ./View ./iconUtils ./_ItemBase ./Badge ./sniff dojo/has!dojo-bidi?dojox/mobile/bidi/TabBarButton".split(" "),function(l,g,m,n,h,f,d,p,c,q,r,t,e,u,k,v){e=g(k("dojo-bidi")?"dojox.mobile.NonBidiTabBarButton":"dojox.mobile.TabBarButton",e,{icon1:"",icon2:"",iconPos1:"",iconPos2:"",selected:!1,transition:"none",tag:"li",
badge:"",badgeClass:"mblDomButtonRedBadge",baseClass:"mblTabBarButton",closeIcon:"mblDomButtonWhiteCross",_selStartMethod:"touch",_selEndMethod:"touch",_moveTo:"",destroy:function(){this.badgeObj&&delete this.badgeObj;this.inherited(arguments)},inheritParams:function(){this.icon&&!this.icon1&&(this.icon1=this.icon);var a=this.getParent();a&&(this.transition||(this.transition=a.transition),this.icon1&&a.iconBase&&"/"===a.iconBase.charAt(a.iconBase.length-1)&&(this.icon1=a.iconBase+this.icon1),this.icon1||
(this.icon1=a.iconBase),this.iconPos1||(this.iconPos1=a.iconPos),this.icon2&&a.iconBase&&"/"===a.iconBase.charAt(a.iconBase.length-1)&&(this.icon2=a.iconBase+this.icon2),this.icon2||(this.icon2=a.iconBase||this.icon1),this.iconPos2||(this.iconPos2=a.iconPos||this.iconPos1),a.closable&&(this.icon1||(this.icon1=this.closeIcon),this.icon2||(this.icon2=this.closeIcon),f.add(this.domNode,"mblTabBarButtonClosable")))},buildRendering:function(){this.domNode=this.srcNodeRef||d.create(this.tag);this.srcNodeRef&&
(this.label||(this.label=n.trim(this.srcNodeRef.innerHTML)),this.srcNodeRef.innerHTML="");this.labelNode=this.box=d.create("div",{className:"mblTabBarButtonLabel"},this.domNode);c.set(this.domNode,"role","tab");c.set(this.domNode,"aria-selected","false");if(this._moveTo=this._getMoveToId()){var a=h.byId(this._moveTo);a&&(c.set(this.domNode,"aria-controls",this._moveTo),c.set(a,"role","tabpanel"),c.set(a,"aria-labelledby",this.id))}this.inherited(arguments)},startup:function(){if(!this._started){this._dragstartHandle=
this.connect(this.domNode,"ondragstart",m.stop);this.connect(this.domNode,"onkeydown","_onClick");var a=this.getParent();a&&a.closable&&(this._clickCloseHandler=this.connect(this.iconDivNode,"onclick","_onCloseButtonClick"),this._keydownCloseHandler=this.connect(this.iconDivNode,"onkeydown","_onCloseButtonClick"),this.iconDivNode.tabIndex="0");this.inherited(arguments);this._isOnLine||(this._isOnLine=!0,this.set({icon:void 0!==this._pendingIcon?this._pendingIcon:this.icon,icon1:this.icon1,icon2:this.icon2}),
delete this._pendingIcon);q.setSelectable(this.domNode,!1)}},onClose:function(a){l.publish("/dojox/mobile/tabClose",[this]);return this.getParent().onCloseButtonClick(this)},_onCloseButtonClick:function(a){a&&"keydown"===a.type&&13!==a.keyCode||!1!==this.onCloseButtonClick(a)&&this.onClose()&&this.destroy()},onCloseButtonClick:function(){},_onClick:function(a){a&&"keydown"===a.type&&13!==a.keyCode||!1!==this.onClick(a)&&this.defaultClickAction(a)},onClick:function(){},_setIcon:function(a,b){this.getParent()&&
(this._set("icon"+b,a),this.iconDivNode||(this.iconDivNode=d.create("div",{className:"mblTabBarButtonIconArea"},this.domNode,"first")),this["iconParentNode"+b]||(this["iconParentNode"+b]=d.create("div",{className:"mblTabBarButtonIconParent mblTabBarButtonIconParent"+b},this.iconDivNode)),this["iconNode"+b]=t.setIcon(a,this["iconPos"+b],this["iconNode"+b],this.alt,this["iconParentNode"+b]),this["icon"+b]=a,f.toggle(this.domNode,"mblTabBarButtonHasIcon",a&&"none"!==a))},_getMoveToId:function(){if(this.moveTo){if("#"===
this.moveTo)return"";var a="";(a="object"===typeof this.moveTo&&this.moveTo.moveTo?this.moveTo.moveTo:this.moveTo)&&(a=r.prototype.convertToId(a));return a}},_setIcon1Attr:function(a){this._setIcon(a,1)},_setIcon2Attr:function(a){this._setIcon(a,2)},_getBadgeAttr:function(){return this.badgeObj&&this.badgeObj.domNode.parentNode&&1==this.badgeObj.domNode.parentNode.nodeType?this.badgeObj.getValue():null},_setBadgeAttr:function(a){this.badgeObj||(this.badgeObj=new u({fontSize:11,className:this.badgeClass}),
p.set(this.badgeObj.domNode,{position:"absolute",top:"0px",right:"0px"}));this.badgeObj.setValue(a);a?this.domNode.appendChild(this.badgeObj.domNode):this.domNode===this.badgeObj.domNode.parentNode&&this.domNode.removeChild(this.badgeObj.domNode)},_setSelectedAttr:function(a){this.inherited(arguments);f.toggle(this.domNode,"mblTabBarButtonSelected",a);c.set(this.domNode,"aria-selected",a?"true":"false");if(this._moveTo){var b=h.byId(this._moveTo);b&&c.set(b,"aria-hidden",a?"false":"true")}}});return k("dojo-bidi")?
g("dojox.mobile.TabBarButton",[e,v]):e});