Skip to content
Permalink
Browse files
Made the closest method evaluate the selector with appropriate context.
  • Loading branch information
rkatic authored and jeresig committed Nov 9, 2009
1 parent b256a3a commit e03aee1
Showing 1 changed file with 2 additions and 1 deletion.
@@ -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;

0 comments on commit e03aee1

Please sign in to comment.