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
6a816ec9
Commit
6a816ec9
authored
Apr 24, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13819: .parent sort direction
parent
7723012e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
traversing.js
src/traversing.js
+1
-1
traversing.js
test/unit/traversing.js
+26
-0
No files found.
src/traversing.js
View file @
6a816ec9
...
@@ -201,7 +201,7 @@ jQuery.each({
...
@@ -201,7 +201,7 @@ jQuery.each({
}
}
// Reverse order for parents* and prev*
// Reverse order for parents* and prev*
if
(
name
.
charAt
(
0
)
===
"p"
)
{
if
(
name
.
charAt
(
0
)
===
"p"
&&
name
!==
"parent"
)
{
ret
=
ret
.
reverse
();
ret
=
ret
.
reverse
();
}
}
}
}
...
...
test/unit/traversing.js
View file @
6a816ec9
...
@@ -673,6 +673,32 @@ test("contents()", function() {
...
@@ -673,6 +673,32 @@ test("contents()", function() {
equal
(
c
[
0
].
nodeValue
,
"hi"
,
"Check node,textnode,comment contents is just the one from span"
);
equal
(
c
[
0
].
nodeValue
,
"hi"
,
"Check node,textnode,comment contents is just the one from span"
);
});
});
test
(
"sort direction"
,
function
()
{
expect
(
12
);
var
elems
=
jQuery
(
"#ap, #select1 > *, #moretests > form"
),
methodDirections
=
{
parent
:
false
,
parents
:
true
,
parentsUntil
:
true
,
next
:
false
,
prev
:
true
,
nextAll
:
false
,
prevAll
:
true
,
nextUntil
:
false
,
prevUntil
:
true
,
siblings
:
false
,
children
:
false
,
contents
:
false
};
jQuery
.
each
(
methodDirections
,
function
(
method
,
reversed
)
{
var
actual
=
elems
[
method
]().
get
(),
forward
=
jQuery
.
unique
(
[].
concat
(
actual
)
);
deepEqual
(
actual
,
reversed
?
forward
.
reverse
()
:
forward
,
"Correct sort direction for "
+
method
);
});
});
test
(
"add(String|Element|Array|undefined)"
,
function
()
{
test
(
"add(String|Element|Array|undefined)"
,
function
()
{
expect
(
15
);
expect
(
15
);
...
...
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