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