git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7088b50
)
Added fix for broken :only-child.
author
John Resig
<jeresig@gmail.com>
Fri, 29 Jun 2007 21:03:27 +0000
(21:03 +0000)
committer
John Resig
<jeresig@gmail.com>
Fri, 29 Jun 2007 21:03:27 +0000
(21:03 +0000)
src/selector/selector.js
patch
|
blob
|
history
diff --git
a/src/selector/selector.js
b/src/selector/selector.js
index
13fd094
..
e6d2d06
100644
(file)
--- a/
src/selector/selector.js
+++ b/
src/selector/selector.js
@@
-16,7
+16,7
@@
jQuery.extend({
// Child Checks
"first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
"last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
- "only-child": "a.parentNode.getElementsByTagName('*').length==1",
+ "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
// Parent Checks
parent: "a.firstChild",