Opened 13 years ago
Closed 13 years ago
#5259 closed enhancement (fixed)
[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: |
Description
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)
Change History (3)
Changed 13 years ago by
Attachment: | patchEvent.txt added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Landed the updated version: http://github.com/jquery/jquery/commit/d251809912c06478fd0c7711736ef6ea3572723e
I had to do it by hand because there were still some whitespace problems.
Also, in the case where you do:
if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
would it be possible to do:
if ( event.relatedTarget ) {
instead? It'd be nice to have this code be generally generic.
Note: See
TracTickets for help on using
tickets.
I've sent a pull request through github. My repository is here: http://github.com/lrbabe/jquery/tree/5fd21143b445bb6e814eb6e54783dac71405e524