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
f1bd0cfc
Commit
f1bd0cfc
authored
Jan 21, 2011
by
rwldrn
Committed by
Anton M
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '8017lint' of
https://github.com/rwldrn/jquery
into 8017lint
parent
1922f311
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
manipulation.js
src/manipulation.js
+4
-3
manipulation.js
test/unit/manipulation.js
+1
-1
No files found.
src/manipulation.js
View file @
f1bd0cfc
...
@@ -486,7 +486,8 @@ jQuery.extend({
...
@@ -486,7 +486,8 @@ jQuery.extend({
clone
:
function
(
elem
,
dataAndEvents
,
deepDataAndEvents
)
{
clone
:
function
(
elem
,
dataAndEvents
,
deepDataAndEvents
)
{
var
clone
=
elem
.
cloneNode
(
true
),
var
clone
=
elem
.
cloneNode
(
true
),
srcElements
,
srcElements
,
destElements
;
destElements
,
i
;
if
(
!
jQuery
.
support
.
noCloneEvent
&&
(
elem
.
nodeType
===
1
||
elem
.
nodeType
===
11
)
&&
!
jQuery
.
isXMLDoc
(
elem
)
)
{
if
(
!
jQuery
.
support
.
noCloneEvent
&&
(
elem
.
nodeType
===
1
||
elem
.
nodeType
===
11
)
&&
!
jQuery
.
isXMLDoc
(
elem
)
)
{
// IE copies events bound via attachEvent when using cloneNode.
// IE copies events bound via attachEvent when using cloneNode.
...
@@ -503,7 +504,7 @@ jQuery.extend({
...
@@ -503,7 +504,7 @@ jQuery.extend({
// Weird iteration because IE will replace the length property
// Weird iteration because IE will replace the length property
// with an element if you are cloning the body and one of the
// with an element if you are cloning the body and one of the
// elements on the page has a name or id of "length"
// elements on the page has a name or id of "length"
for
(
var
i
=
0
;
srcElements
[
i
];
++
i
)
{
for
(
i
=
0
;
srcElements
[
i
];
++
i
)
{
cloneFixAttributes
(
srcElements
[
i
],
destElements
[
i
]
);
cloneFixAttributes
(
srcElements
[
i
],
destElements
[
i
]
);
}
}
...
@@ -521,7 +522,7 @@ jQuery.extend({
...
@@ -521,7 +522,7 @@ jQuery.extend({
destElements
=
clone
.
getElementsByTagName
(
"*"
);
destElements
=
clone
.
getElementsByTagName
(
"*"
);
if
(
srcElements
.
length
)
{
if
(
srcElements
.
length
)
{
for
(
var
i
=
0
;
srcElements
[
i
];
++
i
)
{
for
(
i
=
0
;
srcElements
[
i
];
++
i
)
{
cloneCopyEvent
(
srcElements
[
i
],
destElements
[
i
]
);
cloneCopyEvent
(
srcElements
[
i
],
destElements
[
i
]
);
}
}
}
}
...
...
test/unit/manipulation.js
View file @
f1bd0cfc
...
@@ -880,7 +880,7 @@ test("jQuery.clone() (#8017)", function() {
...
@@ -880,7 +880,7 @@ test("jQuery.clone() (#8017)", function() {
var
main
=
jQuery
(
"#main"
)[
0
],
var
main
=
jQuery
(
"#main"
)[
0
],
clone
=
jQuery
.
clone
(
main
);
clone
=
jQuery
.
clone
(
main
);
equals
(
main
.
child
ren
.
length
,
clone
.
children
.
length
,
"Simple child length to ensure a large dom tree copies correctly"
);
equals
(
main
.
child
Nodes
.
length
,
clone
.
childNodes
.
length
,
"Simple child length to ensure a large dom tree copies correctly"
);
});
});
test
(
"clone()"
,
function
()
{
test
(
"clone()"
,
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