1 define("dijit/_OnDijitClickMixin", [
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 "dojo/_base/unload", // unload.addOnWindowUnload
8 "dojo/_base/window", // win.doc.addEventListener win.doc.attachEvent win.doc.detachEvent
10 ], function(on, array, keys, declare, has, unload, win, a11yclick){
13 // dijit/_OnDijitClickMixin
15 var ret = declare("dijit._OnDijitClickMixin", null, {
18 /*String|Function*/ event,
19 /*String|Function*/ method){
21 // Connects specified obj/event to specified method of this object
22 // and registers for disconnect() on widget destroy.
24 // Provide widget-specific analog to connect.connect, except with the
25 // implicit use of this widget as the target object.
26 // This version of connect also provides a special "ondijitclick"
27 // event which triggers on a click or space or enter keyup.
28 // Events connected with `this.connect` are disconnected upon
31 // A handle that can be passed to `disconnect` in order to disconnect before
32 // the widget is destroyed.
34 // | var btn = new Button();
35 // | // when foo.bar() is called, call the listener we're going to
36 // | // provide in the scope of btn
37 // | btn.connect(foo, "bar", function(){
38 // | console.debug(this.toString());
43 return this.inherited(arguments, [obj, event == "ondijitclick" ? a11yclick : event, method]);
47 ret.a11yclick = a11yclick; // back compat