Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Tweaking some formatting of the closest changes.
- Loading branch information
Showing
1 changed file
with
5 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,14 +62,13 @@ jQuery.fn.extend({ | |
}, | ||
|
||
closest: function( selectors, context ) { | ||
var ret; | ||
var ret = [], i, l, cur = this[0]; | ||
|
||
if ( jQuery.isArray( selectors ) ) { | ||
var cur = this[0], match, matches = {}, selector, level = 1; | ||
ret = []; | ||
var match, matches = {}, selector, level = 1; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jeresig
Author
Member
|
||
|
||
if ( cur && selectors.length ) { | ||
for ( var i = 0, l = selectors.length; i < l; i++ ) { | ||
for ( i = 0, l = selectors.length; i < l; i++ ) { | ||
selector = selectors[i]; | ||
|
||
if ( !matches[selector] ) { | ||
|
@@ -99,10 +98,8 @@ jQuery.fn.extend({ | |
var pos = POS.test( selectors ) ? | ||
jQuery( selectors, context || this.context ) : null; | ||
|
||
ret = []; | ||
|
||
for ( var i = 0, j = this.length; i < j; i++ ) { | ||
var cur = this[i]; | ||
for ( i = 0, l = this.length; i < l; i++ ) { | ||
cur = this[i]; | ||
|
||
while ( cur ) { | ||
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { | ||
|
These declarations could be consolidated onto line 65.