Made the closest method evaluate the selector with appropriate context.
This commit is contained in:
parent
b256a3a266
commit
e03aee1aa6
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue