Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
cde4c326
Commit
cde4c326
authored
Jun 26, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #11969. Never a null moment when checking siblings.
parent
53eb2305
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
traversing.js
src/traversing.js
+1
-1
traversing.js
test/unit/traversing.js
+2
-1
No files found.
src/traversing.js
View file @
cde4c326
...
@@ -158,7 +158,7 @@ function isDisconnected( node ) {
...
@@ -158,7 +158,7 @@ function isDisconnected( node ) {
function
sibling
(
cur
,
dir
)
{
function
sibling
(
cur
,
dir
)
{
do
{
do
{
cur
=
cur
[
dir
];
cur
=
cur
[
dir
];
}
while
(
cur
.
nodeType
!==
1
);
}
while
(
cur
&&
cur
.
nodeType
!==
1
);
return
cur
;
return
cur
;
}
}
...
...
test/unit/traversing.js
View file @
cde4c326
...
@@ -467,11 +467,12 @@ test("parentsUntil([String])", function() {
...
@@ -467,11 +467,12 @@ test("parentsUntil([String])", function() {
});
});
test
(
"next([String])"
,
function
()
{
test
(
"next([String])"
,
function
()
{
expect
(
4
);
expect
(
5
);
equal
(
jQuery
(
"#ap"
).
next
()[
0
].
id
,
"foo"
,
"Simple next check"
);
equal
(
jQuery
(
"#ap"
).
next
()[
0
].
id
,
"foo"
,
"Simple next check"
);
equal
(
jQuery
(
"#ap"
).
next
(
"div"
)[
0
].
id
,
"foo"
,
"Filtered next check"
);
equal
(
jQuery
(
"#ap"
).
next
(
"div"
)[
0
].
id
,
"foo"
,
"Filtered next check"
);
equal
(
jQuery
(
"#ap"
).
next
(
"p"
).
length
,
0
,
"Filtered next check, no match"
);
equal
(
jQuery
(
"#ap"
).
next
(
"p"
).
length
,
0
,
"Filtered next check, no match"
);
equal
(
jQuery
(
"#ap"
).
next
(
"div, p"
)[
0
].
id
,
"foo"
,
"Multiple filters"
);
equal
(
jQuery
(
"#ap"
).
next
(
"div, p"
)[
0
].
id
,
"foo"
,
"Multiple filters"
);
equal
(
jQuery
(
"body"
).
next
().
length
,
0
,
"Simple next check, no match"
);
});
});
test
(
"prev([String])"
,
function
()
{
test
(
"prev([String])"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment