| 1 |
define(["dojo/_base/connect", "dojo/_base/declare", "./Base", "dojo/fx/easing", "dojox/lang/functional"], |
| 2 |
function(hub, declare, Base, dfe, df){ |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
var DEFAULT_DURATION = 400, |
| 17 |
DEFAULT_EASING = dfe.backOut; |
| 18 |
|
| 19 |
return declare("dojox.charting.action2d.PlotAction", Base, { |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
overOutEvents: {onmouseover: 1, onmouseout: 1}, |
| 24 |
|
| 25 |
constructor: function(chart, plot, kwargs){ |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
this.anim = {}; |
| 35 |
|
| 36 |
|
| 37 |
if(!kwargs){ kwargs = {}; } |
| 38 |
this.duration = kwargs.duration ? kwargs.duration : DEFAULT_DURATION; |
| 39 |
this.easing = kwargs.easing ? kwargs.easing : DEFAULT_EASING; |
| 40 |
}, |
| 41 |
|
| 42 |
connect: function(){ |
| 43 |
|
| 44 |
|
| 45 |
this.handle = this.chart.connectToPlot(this.plot.name, this, "process"); |
| 46 |
}, |
| 47 |
|
| 48 |
disconnect: function(){ |
| 49 |
|
| 50 |
|
| 51 |
if(this.handle){ |
| 52 |
hub.disconnect(this.handle); |
| 53 |
this.handle = null; |
| 54 |
} |
| 55 |
}, |
| 56 |
|
| 57 |
reset: function(){ |
| 58 |
|
| 59 |
|
| 60 |
}, |
| 61 |
|
| 62 |
destroy: function(){ |
| 63 |
|
| 64 |
|
| 65 |
this.inherited(arguments); |
| 66 |
df.forIn(this.anim, function(o){ |
| 67 |
df.forIn(o, function(anim){ |
| 68 |
anim.action.stop(true); |
| 69 |
}); |
| 70 |
}); |
| 71 |
this.anim = {}; |
| 72 |
} |
| 73 |
}); |
| 74 |
}); |