aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-11-09 21:51:55 -0500
committerDave Methvin <dave.methvin@gmail.com>2011-11-09 21:51:55 -0500
commite977a85b87a7712215209e8481e51eda98058ab9 (patch)
tree778f04e98c7056b59169d9db8fa5eee58ad4561e /src/event.js
parentdd363d2c0f8d5eb03fe7beccff44a4a35887caa0 (diff)
downloadjquery-e977a85b87a7712215209e8481e51eda98058ab9.tar.gz
jquery-e977a85b87a7712215209e8481e51eda98058ab9.zip
The special.handle hook is for origType, not the mapped type.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/event.js b/src/event.js
index 1bcdc429e..43d246eee 100644
--- a/src/event.js
+++ b/src/event.js
@@ -405,7 +405,6 @@ jQuery.event = {
delegateCount = handlers.delegateCount,
args = [].slice.call( arguments, 0 ),
run_all = !event.exclusive && !event.namespace,
- specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle,
handlerQueue = [],
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
@@ -464,7 +463,8 @@ jQuery.event = {
event.data = handleObj.data;
event.handleObj = handleObj;
- ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args );
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
if ( ret !== undefined ) {
event.result = ret;
@@ -728,7 +728,7 @@ jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
- jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {
+ jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
@@ -737,16 +737,14 @@ jQuery.each({
related = event.relatedTarget,
handleObj = event.handleObj,
selector = handleObj.selector,
- oldType, ret;
+ ret;
- // For a real mouseover/out, always call the handler; for
- // mousenter/leave call the handler if related is outside the target.
+ // For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {
- oldType = event.type;
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
- event.type = oldType;
+ event.type = fix;
}
return ret;
}