//>>built
define("dojox/mobile/_ItemBase","dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/window dojo/dom-class dojo/touch dijit/registry dijit/_Contained dijit/_Container dijit/_WidgetBase ./TransitionEvent ./iconUtils ./sniff ./viewRegistry dojo/has!dojo-bidi?dojox/mobile/bidi/_ItemBase".split(" "),function(e,k,f,g,l,h,w,p,q,r,m,t,n,u,v){f=k(n("dojo-bidi")?"dojox.mobile._NonBidiItemBase":"dojox.mobile._ItemBase",[r,q,p],{icon:"",iconPos:"",alt:"",href:"",hrefTarget:"",moveTo:"",scene:"",clickable:!1,
url:"",urlTarget:"",back:!1,transition:"",transitionDir:1,transitionOptions:null,callback:null,label:"",toggle:!1,selected:!1,tabIndex:"0",_setTabIndexAttr:"",paramsToInherit:"transition,icon",_selStartMethod:"none",_selEndMethod:"none",_delayedSelection:!1,_duration:800,_handleClick:!0,buildRendering:function(){this.inherited(arguments);this._isOnLine=this.inheritParams()},startup:function(){this._started||(this._isOnLine||this.inheritParams(),this._updateHandles(),this.inherited(arguments))},inheritParams:function(){var a=
this.getParent();a&&e.forEach(this.paramsToInherit.split(/,/),function(b){if(b.match(/icon/i)){var c=b+"Base",d=b+"Pos";this[b]&&a[c]&&"/"===a[c].charAt(a[c].length-1)&&(this[b]=a[c]+this[b]);this[b]||(this[b]=a[c]);this[d]||(this[d]=a[d])}this[b]||(this[b]=a[b])},this);return!!a},_updateHandles:function(){this._handleClick&&"touch"===this._selStartMethod?this._onTouchStartHandle||(this._onTouchStartHandle=this.connect(this.domNode,h.press,"_onTouchStart")):this._onTouchStartHandle&&(this.disconnect(this._onTouchStartHandle),
this._onTouchStartHandle=null)},getTransOpts:function(){var a=this.transitionOptions||{};e.forEach("moveTo href hrefTarget url target urlTarget scene transition transitionDir".split(" "),function(b){a[b]=a[b]||this[b]},this);return a},userClickAction:function(){},defaultClickAction:function(a){this.handleSelection(a);!1!==this.userClickAction(a)&&this.makeTransition(a)},handleSelection:function(a){this._delayedSelection&&this.set("selected",!0);this._onTouchEndHandle&&(this.disconnect(this._onTouchEndHandle),
this._onTouchEndHandle=null);a=this.getParent();this.toggle?this.set("selected",!this._currentSel):a&&a.selectOne?this.set("selected",!0):"touch"===this._selEndMethod?this.set("selected",!1):"timer"===this._selEndMethod&&this.defer(function(){this.set("selected",!1)},this._duration)},makeTransition:function(a){if(this.back&&history)history.back();else if(this.href&&this.hrefTarget&&"_self"!=this.hrefTarget)g.global.open(this.href,this.hrefTarget||"_blank"),this._onNewWindowOpened(a);else{var b=this.getTransOpts(),
c=!!(b.moveTo||b.href||b.url||b.target||b.scene);!1!==this._prepareForTransition(a,c?b:null)&&c&&(this.setTransitionPos(a),(new m(this.domNode,b,a)).dispatch())}},_onNewWindowOpened:function(){},_prepareForTransition:function(a,b){},_onTouchStart:function(a){if(!this.getParent().isEditing&&!1!==this.onTouchStart(a)){var b=u.getEnclosingScrollable(this.domNode);b&&l.contains(b.containerNode,"mblScrollableScrollTo2")||(this._onTouchEndHandle||"touch"!==this._selStartMethod||(this._onTouchMoveHandle=
this.connect(g.body(),h.move,"_onTouchMove"),this._onTouchEndHandle=this.connect(g.body(),h.release,"_onTouchEnd")),this.touchStartX=a.touches?a.touches[0].pageX:a.clientX,this.touchStartY=a.touches?a.touches[0].pageY:a.clientY,this._currentSel=this.selected,this._delayedSelection?this._selTimer=this.defer(function(){this.set("selected",!0)},100):this.set("selected",!0))}},onTouchStart:function(){},_onTouchMove:function(a){var b=a.touches?a.touches[0].pageY:a.clientY;if(4<=Math.abs((a.touches?a.touches[0].pageX:
a.clientX)-this.touchStartX)||4<=Math.abs(b-this.touchStartY))this.cancel(),(a=this.getParent())&&a.selectOne?this._prevSel&&this._prevSel.set("selected",!0):this.set("selected",!1)},_disconnect:function(){this.disconnect(this._onTouchMoveHandle);this.disconnect(this._onTouchEndHandle);this._onTouchMoveHandle=this._onTouchEndHandle=null},cancel:function(){this._selTimer&&(this._selTimer.remove(),this._selTimer=null);this._disconnect()},_onTouchEnd:function(a){if(this._selTimer||!this._delayedSelection)this.cancel(),
this._onClick(a)},setTransitionPos:function(a){for(var b=this;b=b.getParent(),b&&!l.contains(b.domNode,"mblView"););b&&(b.clickedPosX=a.clientX,b.clickedPosY=a.clientY)},transitionTo:function(a,b,c,d){(new m(this.domNode,a&&"object"===typeof a?a:{moveTo:a,href:b,url:c,scene:d,transition:this.transition,transitionDir:this.transitionDir})).dispatch()},_setIconAttr:function(a){this._isOnLine?(this._set("icon",a),this.iconNode=t.setIcon(a,this.iconPos,this.iconNode,this.alt,this.iconParentNode,this.refNode,
this.position)):this._pendingIcon=a},_setLabelAttr:function(a){this._set("label",a);this.labelNode.innerHTML=this._cv?this._cv(a):a},_setSelectedAttr:function(a){if(a){var b=this.getParent();b&&b.selectOne&&(b=e.filter(b.getChildren(),function(a){return a.selected}),e.forEach(b,function(a){this._prevSel=a;a.set("selected",!1)},this))}this._set("selected",a)}});return n("dojo-bidi")?k("dojox.mobile._ItemBase",[f,v]):f});