X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fevent.js;h=d91231e8683ee99d7d1e042a04f98c5473f6a963;hb=9195107dbb13ad34ae4e9f7cb1df5d79e4748560;hp=c6a953b2fb5636814ed6b2fce0941ef881578b79;hpb=467063a2e25bae25adfa2e9ab789c62e241c9c56;p=jquery.git diff --git a/src/event.js b/src/event.js index c6a953b..d91231e 100644 --- a/src/event.js +++ b/src/event.js @@ -112,6 +112,10 @@ jQuery.event = { if ( special.add ) { special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } } // Add the function to the element's handler list @@ -604,27 +608,24 @@ var withinElement = function( event ) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent !== this ) { - // Firefox sometimes assigns relatedTarget a XUL element - // which we cannot access the parentNode property of - try { + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { parent = parent.parentNode; - - // assuming we've left the element since we most likely mousedover a xul element - } catch(e) { - break; } - } - if ( parent !== this ) { - // set the correct event type - event.type = event.data; + if ( parent !== this ) { + // set the correct event type + event.type = event.data; - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } }, // In case of event delegation, we only need to rename the event.type, @@ -956,7 +957,14 @@ jQuery.each(["live", "die"], function( i, name ) { } preType = type; - type = (liveMap[ type ] || type) + namespaces; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } if ( name === "live" ) { // bind live handler