| 1 | define([ |
| 2 | "dojo/on", |
| 3 | "dojo/_base/array", // array.forEach |
| 4 | "dojo/keys", // keys.ENTER keys.SPACE |
| 5 | "dojo/_base/declare", // declare |
| 6 | "dojo/has", // has("dom-addeventlistener") |
| 7 | "./a11yclick" |
| 8 | ], function(on, array, keys, declare, has, a11yclick){ |
| 9 | |
| 10 | // module: |
| 11 | // dijit/_OnDijitClickMixin |
| 12 | |
| 13 | var ret = declare("dijit._OnDijitClickMixin", null, { |
| 14 | // summary: |
| 15 | // Deprecated. New code should access the dijit/a11yclick event directly, ex: |
| 16 | // | this.own(on(node, a11yclick, function(){ ... })); |
| 17 | // |
| 18 | // Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work. |
| 19 | // It also used to be necessary to make templates with ondijitclick work, but now you can just require |
| 20 | // dijit/a11yclick. |
| 21 | |
| 22 | connect: function(obj, event, method){ |
| 23 | // override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work |
| 24 | return this.inherited(arguments, [obj, event == "ondijitclick" ? a11yclick : event, method]); |
| 25 | } |
| 26 | }); |
| 27 | |
| 28 | ret.a11yclick = a11yclick; // back compat |
| 29 | |
| 30 | return ret; |
| 31 | }); |