Rev | Line | |
---|
[483] | 1 | define(["dojo/_base/connect", "dojo/_base/declare", "./Base"], |
---|
| 2 | function(hub, declare, Base){ |
---|
| 3 | |
---|
| 4 | return declare("dojox.charting.action2d.ChartAction", Base, { |
---|
| 5 | // summary: |
---|
| 6 | // Base action class for chart actions. |
---|
| 7 | |
---|
| 8 | constructor: function(chart, plot){ |
---|
| 9 | // summary: |
---|
| 10 | // Create a new base chart action. |
---|
| 11 | // chart: dojox/charting/Chart |
---|
| 12 | // The chart this action applies to. |
---|
| 13 | // plot: String|dojox/charting/plot2d/Base? |
---|
| 14 | // Optional target plot for this chart action. Default is "default". |
---|
| 15 | }, |
---|
| 16 | |
---|
| 17 | connect: function(){ |
---|
| 18 | // summary: |
---|
| 19 | // Connect this action to the chart. |
---|
| 20 | for(var i = 0; i < this._listeners.length; ++i){ |
---|
| 21 | this._listeners[i].handle = hub.connect(this.chart.node, this._listeners[i].eventName, |
---|
| 22 | this, this._listeners[i].methodName); |
---|
| 23 | } |
---|
| 24 | }, |
---|
| 25 | |
---|
| 26 | disconnect: function(){ |
---|
| 27 | // summary: |
---|
| 28 | // Disconnect this action from the chart. |
---|
| 29 | for(var i = 0; i < this._listeners.length; ++i){ |
---|
| 30 | hub.disconnect(this._listeners[i].handle); |
---|
| 31 | delete this._listeners[i].handle; |
---|
| 32 | } |
---|
| 33 | } |
---|
| 34 | }); |
---|
| 35 | |
---|
| 36 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.