event-mouseenter-debug.js revision 7d1157dbcdfedd79881117578f3790d06a2cd317
/**
* Adds support for mouseenter/mouseleave events
* @module event
* @submodule event-mouseenter
*/
listeners = {},
eventConfig = {
// Need to use Y.all because if el is a string it could be a
// selector that returns a NodeList
}, Event, true, false);
return availHandle;
}
}
// The name of the custom event
// Bind an actual DOM event listener that will call the
// the custom event
if (!listener) {
// Hook into the _delete method for the Custom Event wrapper of this
// DOM Event in order to clean up the 'listeners' map and unsubscribe
// the associated Custom Event listeners fired by this DOM event
// listeners of the Custom Event.
// Delete this event from the map of known mouseenter
// and mouseleave listeners
delete listeners[sEventName];
Y.log("DOM event listener associated with the " + sEventName + " Custom Event removed. Removing all " + sEventName + " listeners.", "info", "Event");
// Unsubscribe all listeners of the Custom Event fired
// by this DOM event.
Y.detachAll(sEventName);
}
listener = {};
}
// Remove the element from the args
// Subscribe to the custom event
// Hook into the detach method of the handle in order to clean up the
// 'listeners' map and remove the associated DOM event handler
// responsible for firing this Custom Event if all listener for this
// event have been removed.
Y.after(function () {
Y.log("No more listeners for the " + sEventName + " Custom Event. Removing its associated DOM event listener.", "info", "Event");
}
}, ceHandle, "detach");
return ceHandle;
}
};
var relatedTarget = e.relatedTarget,
if (currentTarget !== relatedTarget &&
contextFn: function() {
return currentTarget;
}
});
}
};
/**
* Sets up a "mouseenter" listener—a listener that is called the first time
* the user's mouse enters the specified element(s).
*
* @event mouseenter
* @param type {string} "mouseenter"
* @param fn {function} The method the event invokes.
* @param el {string|node} The element(s) to assign the listener to.
* @param spec {string} Optional. String representing a selector that must
* match the target of the event in order for the listener to be called.
* @return {EventHandle} the detach handle
* @for YUI
*/
/**
* Sets up a "mouseleave" listener—a listener that is called the first time
* the user's mouse leaves the specified element(s).
*
* @event mouseleave
* @param type {string} "mouseleave"
* @param fn {function} The method the event invokes.
* @param el {string|node} The element(s) to assign the listener to.
* @param spec {string} Optional. String representing a selector that must
* match the target of the event in order for the listener to be called.
* @return {EventHandle} the detach handle
* @for YUI
*/