aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-13 05:45:48 -0500
committerjeresig <jeresig@gmail.com>2010-02-13 05:45:48 -0500
commit6a82f2ae63263ed9deaff9d9dcc775a2c0cde343 (patch)
treea000b9c109bb842eb89d169e9c2f3283b5c0d09b /src/event.js
parentdd5c26304af1c5f884ebf0baa5df28a2f8a8c4cc (diff)
downloadjquery-6a82f2ae63263ed9deaff9d9dcc775a2c0cde343.tar.gz
jquery-6a82f2ae63263ed9deaff9d9dcc775a2c0cde343.zip
Make sure that mousing over XUL elements results in no trigger of a mouseleave. Fixes #6013.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/event.js b/src/event.js
index d59533f06..6e65438ac 100644
--- a/src/event.js
+++ b/src/event.js
@@ -604,27 +604,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,