git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b256a3a
)
Made the closest method evaluate the selector with appropriate context.
author
Robert Katić
<robert.katic@gmail.com>
Mon, 9 Nov 2009 11:39:29 +0000
(12:39 +0100)
committer
John Resig
<jeresig@gmail.com>
Mon, 9 Nov 2009 11:39:29 +0000
(12:39 +0100)
src/traversing.js
patch
|
blob
|
history
diff --git
a/src/traversing.js
b/src/traversing.js
index
f7c86f1
..
85976a3
100644
(file)
--- a/
src/traversing.js
+++ b/
src/traversing.js
@@
-52,7
+52,8
@@
jQuery.fn.extend({
},
closest: function( selector, context ) {
- var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;
+ var pos = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) : null;
return this.map(function(){
var cur = this, closer = 0;