Search code examples
javascriptyui3browser-pluginfirebreath

Using YUI 3 Event with custom events in browser plugin


I made a plugin with Firebreath, with a custom event, and I would like to register a callback with YUI Event.

Y.on( "mycustomevent", callback, pluginNode );

Does not register my callback, whereas

pluginNode.addEventListener( "mycustomevent", callback, false );

does (on Firefox, not on IE).

How can I use YUI to register my event?


Solution

  • I found the solution. Adding my event to Y.Node.DOM_EVENTS, it works:

    Y.mix( Y.Node.DOM_EVENTS, {
        mycustomevent: 1
    } );