aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2012-07-23 12:48:29 -0400
committerTimmy Willison <timmywillisn@gmail.com>2012-07-23 12:49:45 -0400
commite761e0c6e0561093ff1e52d0cba6ace04daa8798 (patch)
treebee27d3b055ea31ca8bdb5a0aed8dad1149dac33 /src/traversing.js
parenta08a18b80adc403dc2914ee6b1ca8752aeddef30 (diff)
downloadjquery-e761e0c6e0561093ff1e52d0cba6ace04daa8798.tar.gz
jquery-e761e0c6e0561093ff1e52d0cba6ace04daa8798.zip
Support event delegation with relative selectors. Fixes #10762. Closes gh-860.
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/traversing.js b/src/traversing.js
index 625b9f4c9..321c25197 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -1,7 +1,7 @@
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
- POS = jQuery.expr.match.globalPOS,
+ rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
@@ -72,9 +72,9 @@ jQuery.fn.extend({
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
- // If this is a positional selector, check membership in the returned set
+ // If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
- POS.test( selector ) ?
+ rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
@@ -85,7 +85,7 @@ jQuery.fn.extend({
i = 0,
l = this.length,
ret = [],
- pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;