event-hover-debug.js revision bea4478bf62936f0e478e02fff1a4ccf68d584da
82d0cf8c731b23f6a2fbb31e3e696e629444363eTrippYUI.add('event-hover', function(Y) {
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp
82d0cf8c731b23f6a2fbb31e3e696e629444363eTrippvar isFunction = Y.Lang.isFunction,
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp noop = function () {},
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp conf = {
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp processArgs: function (args) {
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp // Y.delegate('hover', over, out, '#container', '.filter')
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp // comes in as ['hover', over, out, '#container', '.filter'], but
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp // node.delegate('hover', over, out, '.filter')
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp // comes in as ['hover', over, containerEl, out, '.filter']
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp var i = isFunction(args[2]) ? 2 : 3;
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp return (isFunction(args[i])) ? args.splice(i,1)[0] : noop;
87a49173dbc22a145cb87e605cca83fd42524377Tripp },
87a49173dbc22a145cb87e605cca83fd42524377Tripp
87a49173dbc22a145cb87e605cca83fd42524377Tripp on: function (node, sub, notifier, filter) {
87a49173dbc22a145cb87e605cca83fd42524377Tripp sub._detach = node[(filter) ? "delegate" : "on"]({
87a49173dbc22a145cb87e605cca83fd42524377Tripp mouseenter: Y.bind(notifier.fire, notifier),
87a49173dbc22a145cb87e605cca83fd42524377Tripp mouseleave: sub._extra
87a49173dbc22a145cb87e605cca83fd42524377Tripp }, filter);
87a49173dbc22a145cb87e605cca83fd42524377Tripp },
87a49173dbc22a145cb87e605cca83fd42524377Tripp
87a49173dbc22a145cb87e605cca83fd42524377Tripp detach: function (node, sub, notifier) {
87a49173dbc22a145cb87e605cca83fd42524377Tripp sub._detacher.detach();
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp }
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp };
82d0cf8c731b23f6a2fbb31e3e696e629444363eTripp
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTrippconf.delegate = conf.on;
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTrippconf.detachDelegate = conf.detach;
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTrippY.Event.define("hover", conf);
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp}, '@VERSION@' ,{requires:['event-mouseenter']});
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp