event-hover.js revision d3493226019e9b97a9141fbf8320e8680144af7e
/**
* Adds support for a "hover" event. The event provides a convenience wrapper
* for subscribing separately to mouseenter and mouseleave. The signature for
* subscribing to the event is</p>
*
* <pre><code>node.on("hover", overFn, outFn);
* node.delegate("hover", overFn, outFn, ".filterSelector");
* Y.on("hover", overFn, outFn, ".targetSelector");
* Y.delegate("hover", overFn, outFn, "#container", ".filterSelector");
* </code></pre>
*
* <p>Additionally, for compatibility with a more typical subscription
* signature, the following are also supported:</p>
*
* <pre><code>Y.on("hover", overFn, ".targetSelector", outFn);
* Y.delegate("hover", overFn, "#container", outFn, ".filterSelector");
* </code></pre>
*
* @module event
* @submodule event-hover
*/
noop = function () {},
conf = {
processArgs: function (args) {
// Y.delegate('hover', over, out, '#container', '.filter')
// comes in as ['hover', over, out, '#container', '.filter'], but
// node.delegate('hover', over, out, '.filter')
// comes in as ['hover', over, containerEl, out, '.filter']
},
mouseenter: function (e) {
e.phase = 'over';
},
mouseleave: function (e) {
e.type = 'hover';
e.phase = 'out';
}
}, filter);
},
}
};