diff options
author | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-14 18:59:18 +0400 |
commit | 1354d17270961fff662d40f90521223f8fd0d73b (patch) | |
tree | e9266be71587e47c800303446e968a6d3565e2cf /lib/dojo/Evented.js.uncompressed.js | |
parent | d04f8c826f5283765f52cf6b98b42a1ed8f2d6bc (diff) |
update dojo to 1.7.3
Diffstat (limited to 'lib/dojo/Evented.js.uncompressed.js')
-rw-r--r-- | lib/dojo/Evented.js.uncompressed.js | 32 |
1 files changed, 32 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..c39c9e71a --- /dev/null +++ b/lib/dojo/Evented.js.uncompressed.js @@ -0,0 +1,32 @@ +define("dojo/Evented", ["./aspect", "./on"], function(aspect, on){ + // summary: + // The export of this module is 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 emiting 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", ...}); + + "use strict"; + var after = aspect.after; + function Evented(){ + } + 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; +}); |