git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jquery core: closes #5186. getElementsByTagName optimization was breaking the selecto...
[jquery.git]
/
src
/
traversing.js
diff --git
a/src/traversing.js
b/src/traversing.js
index
e8a8938
..
1342c59
100644
(file)
--- a/
src/traversing.js
+++ b/
src/traversing.js
@@
-51,10
+51,9
@@
jQuery.fn.extend({
return this.pushStack( jQuery.winnow(this, selector, true), "filter", selector );
},
return this.pushStack( jQuery.winnow(this, selector, true), "filter", selector );
},
- closest: function( selector ) {
+ 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) : null,
- closer = 0,
- context = this.context;
+ closer = 0;
return this.map(function(){
var cur = this;
return this.map(function(){
var cur = this;
@@
-79,7
+78,17
@@
jQuery.fn.extend({
},
eq: function( i ) {
},
eq: function( i ) {
- return this.slice( i, +i + 1 );
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
},
slice: function() {
},
slice: function() {