eventprovider.html revision ba9518d6366a8c1c3a1d027fdc652d92759e101b
18161N/A Y.example.EventReceiver = function() { };
18161N/A Y.example.EventReceiver.prototype.on = function(type, f) {
18161N/A var ev = this.publish(type);
18161N/A var er = new Y.example.EventReceiver();
15225N/A this.publish('myEvent');
15225N/A this.after('myEvent', this.handler, this, 'AFTER').on('foo, myEvent', this.handler, this, 5, 6).on('foo, myEvent2', this.handler2, this, 7, 8);
Animal.prototype.handler = function(arg) {
Y.log('Animal');
Y.log(this);
Y.log(arguments);
Animal.prototype.handler2 = function(arg) {
Y.log('Animal handler2');
Y.log(this);
Y.log(arguments);
Animal.prototype.constructor.apply(this, arguments);
Y.extend(Dog, Animal, {
Y.log('Dog');
Y.log(this);
Y.log(arguments);
Animal.prototype.constructor.apply(this, arguments);
Y.extend(Cat, Animal, {
Y.log('Cat');
Y.log(this);
Y.log(arguments);
d.fire('myEvent', 1, 2);
c.fire('myEvent', 3, 4);
c.detach('foo, myEvent');
c.fire('myEvent', 'should not see unless this is AFTER');
c.fire('myEvent2', 'Should see Animal\' imp');
// Y.log("detacher, menu:click".split(/([,:])\s*/))
// Y.log("detacher menu click".split(/([,:])\s*/))