aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-26 09:26:14 -0500
committerjeresig <jeresig@gmail.com>2010-02-26 09:26:14 -0500
commit26b0e913dda386b6b2848196689a02a2da6aa40d (patch)
tree4f9746aca991267d767ca338e4151f20aaaeb0b4 /src/traversing.js
parent7e6b20e2e813e774ce970d17215260d54bf15cd7 (diff)
downloadjquery-26b0e913dda386b6b2848196689a02a2da6aa40d.tar.gz
jquery-26b0e913dda386b6b2848196689a02a2da6aa40d.zip
Make sure that live events bubble unless explicitly told not to, like a normal event. Fixes #6182.
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/traversing.js b/src/traversing.js
index a99dfdf1c..6ae9924a3 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -82,7 +82,7 @@ jQuery.fn.extend({
closest: function( selectors, context ) {
if ( jQuery.isArray( selectors ) ) {
- var ret = [], cur = this[0], match, matches = {}, selector;
+ var ret = [], cur = this[0], match, matches = {}, selector, level = 1;
if ( cur && selectors.length ) {
for ( var i = 0, l = selectors.length; i < l; i++ ) {
@@ -100,11 +100,11 @@ jQuery.fn.extend({
match = matches[selector];
if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
- ret.push({ selector: selector, elem: cur });
- delete matches[selector];
+ ret.push({ selector: selector, elem: cur, level: level });
}
}
cur = cur.parentNode;
+ level++;
}
}