Made the closest method evaluate the selector with appropriate context.
This commit is contained in:
parent
b256a3a266
commit
e03aee1aa6
|
@ -52,7 +52,8 @@ jQuery.fn.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
closest: function( selector, context ) {
|
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(){
|
return this.map(function(){
|
||||||
var cur = this, closer = 0;
|
var cur = this, closer = 0;
|
||||||
|
|
Loading…
Reference in a new issue