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 e03aee1aa6d26107328052998bdf9f54fa08d9ef
Showing with 2 additions and 1 deletion.
  1. +2 −1 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;

0 comments on commit e03aee1

Please sign in to comment.
You can’t perform that action at this time.