Commit e03aee1a authored by Robert Katić's avatar Robert Katić Committed by John Resig

Made the closest method evaluate the selector with appropriate context.

parent b256a3a2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment