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
94340607
Commit
94340607
authored
Jan 07, 2013
by
Oleg
Committed by
Dave Methvin
Jan 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify .wrapAll() and fix style. Close gh-1116.
parent
b6abb31d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
manipulation.js
src/manipulation.js
+13
-10
No files found.
src/manipulation.js
View file @
94340607
...
...
@@ -29,30 +29,33 @@ jQuery.fn.extend({
return
jQuery
.
access
(
this
,
function
(
value
)
{
return
value
===
undefined
?
jQuery
.
text
(
this
)
:
this
.
empty
().
append
(
(
this
[
0
]
&&
this
[
0
].
ownerDocument
||
document
).
createTextNode
(
value
)
);
this
.
empty
().
append
(
(
this
[
0
]
&&
this
[
0
].
ownerDocument
||
document
).
createTextNode
(
value
)
);
},
null
,
value
,
arguments
.
length
);
},
wrapAll
:
function
(
html
)
{
var
wrap
;
if
(
jQuery
.
isFunction
(
html
)
)
{
return
this
.
each
(
function
(
i
)
{
jQuery
(
this
).
wrapAll
(
html
.
call
(
this
,
i
)
);
return
this
.
each
(
function
(
i
)
{
jQuery
(
this
).
wrapAll
(
html
.
call
(
this
,
i
)
);
});
}
if
(
this
[
0
]
)
{
if
(
this
[
0
]
)
{
// The elements to wrap the target around
var
wrap
=
jQuery
(
html
,
this
[
0
].
ownerDocument
).
eq
(
0
).
clone
(
true
);
wrap
=
jQuery
(
html
,
this
[
0
].
ownerDocument
).
eq
(
0
).
clone
(
true
);
if
(
this
[
0
].
parentNode
)
{
wrap
.
insertBefore
(
this
[
0
]
);
if
(
this
[
0
].
parentNode
)
{
wrap
.
insertBefore
(
this
[
0
]
);
}
wrap
.
map
(
function
()
{
var
elem
=
this
;
while
(
elem
.
first
Child
&&
elem
.
firstChild
.
nodeType
===
1
)
{
elem
=
elem
.
firstChild
;
while
(
elem
.
first
ElementChild
)
{
elem
=
elem
.
first
Element
Child
;
}
return
elem
;
...
...
@@ -188,7 +191,7 @@ jQuery.fn.extend({
html
:
function
(
value
)
{
return
jQuery
.
access
(
this
,
function
(
value
)
{
var
elem
=
this
[
0
]
||
{},
var
elem
=
this
[
0
]
||
{},
i
=
0
,
l
=
this
.
length
;
...
...
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