//>>built
define("dojox/charting/action2d/TouchIndicator",["dojo/_base/lang","dojo/_base/declare","dojo/_base/event","dojo/has","dojo/touch","dojo/_base/connect","./ChartAction","./_IndicatorElement","dojox/lang/utils"],function(_1,_2,_3,_4,_5,_6,_7,_8,du){
return _2("dojox.charting.action2d.TouchIndicator",_7,{defaultParams:{series:"",dualIndicator:false,vertical:true,autoScroll:true,fixed:true,precision:0,lines:true,labels:true,markers:true},optionalParams:{lineStroke:{},outlineStroke:{},shadowStroke:{},lineFill:{},stroke:{},outline:{},shadow:{},fill:{},fillFunc:null,labelFunc:null,font:"",fontColor:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerSymbol:"",offset:{},start:false},constructor:function(_9,_a,_b){
if(_4("touch-events")){
this._listeners=[{eventName:"touchstart",methodName:"onTouchStart"},{eventName:"touchmove",methodName:"onTouchMove"},{eventName:"touchend",methodName:"onTouchEnd"},{eventName:"touchcancel",methodName:"onTouchEnd"}];
}else{
this._listeners=[{eventName:_5.press,methodName:"onTouchStart"},{eventName:_5.move,methodName:"onTouchMove"},{eventName:_5.cancel,methodName:"onTouchEnd"}];
}
this.opt=_1.clone(this.defaultParams);
du.updateWithObject(this.opt,_b);
du.updateWithPattern(this.opt,_b,this.optionalParams);
this._uName="touchIndicator"+this.opt.series;
this.connect();
},connect:function(){
this.inherited(arguments);
this.chart.addPlot(this._uName,{type:_8,inter:this});
},disconnect:function(){
var _c=this.chart.getPlot(this._uName);
if(_c.pageCoord){
this.onTouchEnd();
}
this.chart.removePlot(this._uName);
this.inherited(arguments);
},onChange:function(_d){
},onTouchStart:function(_e){
if(!_e.touches||_e.touches.length==1){
this._onTouchSingle(_e,true);
}else{
if(this.opt.dualIndicator&&_e.touches.length==2){
this._onTouchDual(_e);
}
}
},onTouchMove:function(_f){
if(!_f.touches||_f.touches.length==1){
this._onTouchSingle(_f);
}else{
if(this.opt.dualIndicator&&_f.touches.length==2){
this._onTouchDual(_f);
}
}
},_onTouchSingle:function(_10,_11){
if(!_4("touch-events")&&!this._onTouchEndHandler){
this._onTouchEndHandler=_6.connect(this.chart.node.ownerDocument,_5.release,this,"onTouchEnd");
}
if(this.chart._delayedRenderHandle&&!_11){
this.chart.render();
}
var _12=this.chart.getPlot(this._uName);
_12.pageCoord={x:_10.touches?_10.touches[0].pageX:_10.pageX,y:_10.touches?_10.touches[0].pageY:_10.pageY};
_12.dirty=true;
if(_11){
this.chart.delayedRender();
}else{
this.chart.render();
}
_3.stop(_10);
},_onTouchDual:function(_13){
if(!_4("touch-events")&&!this._onTouchEndHandler){
this._onTouchEndHandler=_6.connect(this.chart.node.ownerDocument,_5.release,this,"onTouchEnd");
}
if(this.chart._delayedRenderHandle){
this.chart.render();
}
var _14=this.chart.getPlot(this._uName);
_14.pageCoord={x:_13.touches[0].pageX,y:_13.touches[0].pageY};
_14.secondCoord={x:_13.touches[1].pageX,y:_13.touches[1].pageY};
_14.dirty=true;
this.chart.render();
_3.stop(_13);
},onTouchEnd:function(_15){
if(!_4("touch-events")&&this._onTouchEndHandler){
_6.disconnect(this._onTouchEndHandler);
this._onTouchEndHandler=null;
}
var _16=this.chart.getPlot(this._uName);
_16.stopTrack();
_16.pageCoord=null;
_16.secondCoord=null;
_16.dirty=true;
this.chart.delayedRender();
}});
});
