summaryrefslogtreecommitdiff
path: root/lib/dojo/Evented.js.uncompressed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-18 10:26:24 +0400
committerAndrew Dolgov <[email protected]>2013-03-18 10:26:26 +0400
commitf0cfe83e3725f9a3928da97a6e3085e79cb25309 (patch)
tree4b0af188defaa807c7bc6ff3a101b41c9166c463 /lib/dojo/Evented.js.uncompressed.js
parent9a2885da170ffd64358b99194095851a2d09c1b6 (diff)
upgrade dojo to 1.8.3 (refs #570)
Diffstat (limited to 'lib/dojo/Evented.js.uncompressed.js')
-rw-r--r--lib/dojo/Evented.js.uncompressed.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/dojo/Evented.js.uncompressed.js b/lib/dojo/Evented.js.uncompressed.js
new file mode 100644
index 000000000..08a7fb7e4
--- /dev/null
+++ b/lib/dojo/Evented.js.uncompressed.js
@@ -0,0 +1,35 @@
+define("dojo/Evented", ["./aspect", "./on"], function(aspect, on){
+ // module:
+ // dojo/Evented
+
+ "use strict";
+ var after = aspect.after;
+ function Evented(){
+ // summary:
+ // A class that can be used as a mixin or base class,
+ // to add on() and emit() methods to a class
+ // for listening for events and emitting events:
+ //
+ // | define(["dojo/Evented"], function(Evented){
+ // | var EventedWidget = dojo.declare([Evented, dijit._Widget], {...});
+ // | widget = new EventedWidget();
+ // | widget.on("open", function(event){
+ // | ... do something with event
+ // | });
+ // |
+ // | widget.emit("open", {name:"some event", ...});
+ }
+ Evented.prototype = {
+ on: function(type, listener){
+ return on.parse(this, type, listener, function(target, type){
+ return after(target, 'on' + type, listener, true);
+ });
+ },
+ emit: function(type, event){
+ var args = [this];
+ args.push.apply(args, arguments);
+ return on.emit.apply(on, args);
+ }
+ };
+ return Evented;
+});