Side navigation
Ticket #3027: focus_doubble.patch
File focus_doubble.patch, 1.2 KB (added by trixi, June 11, 2008 07:59PM UTC)
Index: event.js
===================================================================
--- event.js (revision 5718)
+++ event.js (working copy)
@@ -202,8 +202,8 @@
if ( handle )
val = handle.apply( elem, data );
- // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
- if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
+ // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) and focus cause ie would throw 2 events
+ if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click") || type == "focus") && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
val = false;
// Extra functions don't get the custom event object
@@ -220,7 +220,7 @@
}
// Trigger the native events (except for clicks on links)
- if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
+ if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") && type != "focus" ) {
this.triggered = true;
try {
elem[ type ]();
Download in other formats:
Original Format
File focus_doubble.patch, 1.2 KB (added by trixi, June 11, 2008 07:59PM UTC)
Index: event.js
===================================================================
--- event.js (revision 5718)
+++ event.js (working copy)
@@ -202,8 +202,8 @@
if ( handle )
val = handle.apply( elem, data );
- // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
- if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
+ // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) and focus cause ie would throw 2 events
+ if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click") || type == "focus") && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
val = false;
// Extra functions don't get the custom event object
@@ -220,7 +220,7 @@
}
// Trigger the native events (except for clicks on links)
- if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
+ if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") && type != "focus" ) {
this.triggered = true;
try {
elem[ type ]();