Skip to main content

Bug Tracker

Side navigation

#5259 closed enhancement (fixed)

Opened September 16, 2009 07:58PM UTC

Closed November 09, 2009 12:03PM UTC

[patch] Event delegation for mouseenter and mouseleave

Reported by: lrbabe Owned by: brandon
Priority: major Milestone: 1.4
Component: event Version: 1.3.2
Keywords: delegation Cc:
Blocked by: Blocking:

This patch adds a private "delegate" function used to bypass "withinElement" in case of event delegation and adds an extra test for the event.relatedTarget in liveHandler for the mouseenter and mouseleave events.

Attachments (1)
  • patchEvent.txt (1.7 KB) - added by lrbabe September 16, 2009 08:27PM UTC.
Change History (2)

Changed November 03, 2009 11:45PM UTC by lrbabe comment:1

I've sent a pull request through github. My repository is here:

Changed November 09, 2009 12:03PM UTC by john comment:2

resolution: → fixed
status: newclosed

Landed the updated version:

I had to do it by hand because there were still some whitespace problems.

Also, in the case where you do:

if ( === "mouseenter" || === "mouseleave" ) {

would it be possible to do:

if ( event.relatedTarget ) {

instead? It'd be nice to have this code be generally generic.