mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Cleanup bubbling focus and blur events
- Use cached event instead of jQuery.event - Do not cache event.special if you use it only once
This commit is contained in:
parent
e03aee1aa6
commit
9a69b2cf08
@ -575,7 +575,6 @@ jQuery.each({
|
|||||||
blur: "focusout"
|
blur: "focusout"
|
||||||
}, function( orig, fix ){
|
}, function( orig, fix ){
|
||||||
var event = jQuery.event,
|
var event = jQuery.event,
|
||||||
special = event.special,
|
|
||||||
handle = event.handle;
|
handle = event.handle;
|
||||||
|
|
||||||
function ieHandler() {
|
function ieHandler() {
|
||||||
@ -583,18 +582,18 @@ jQuery.each({
|
|||||||
return handle.apply(this, arguments);
|
return handle.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
special[orig] = {
|
event.special[orig] = {
|
||||||
setup:function() {
|
setup:function() {
|
||||||
if ( this.addEventListener )
|
if ( this.addEventListener )
|
||||||
this.addEventListener( orig, handle, true );
|
this.addEventListener( orig, handle, true );
|
||||||
else
|
else
|
||||||
jQuery.event.add( this, fix, ieHandler );
|
event.add( this, fix, ieHandler );
|
||||||
},
|
},
|
||||||
teardown:function() {
|
teardown:function() {
|
||||||
if ( this.removeEventListener )
|
if ( this.removeEventListener )
|
||||||
this.removeEventListener( orig, handle, true );
|
this.removeEventListener( orig, handle, true );
|
||||||
else
|
else
|
||||||
jQuery.event.remove( this, fix, ieHandler );
|
event.remove( this, fix, ieHandler );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user