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
452e3276
Commit
452e3276
authored
Dec 13, 2012
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compress -16 min+gzip
parent
643ecf9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
31 deletions
+31
-31
css.js
src/css.js
+18
-20
manipulation.js
src/manipulation.js
+13
-11
No files found.
src/css.js
View file @
452e3276
...
@@ -273,7 +273,7 @@ jQuery.extend({
...
@@ -273,7 +273,7 @@ jQuery.extend({
},
},
// A method for quickly swapping in/out CSS properties to get correct calculations
// A method for quickly swapping in/out CSS properties to get correct calculations
swap
:
function
(
elem
,
options
,
callback
)
{
swap
:
function
(
elem
,
options
,
callback
,
args
)
{
var
ret
,
name
,
var
ret
,
name
,
old
=
{};
old
=
{};
...
@@ -283,7 +283,7 @@ jQuery.extend({
...
@@ -283,7 +283,7 @@ jQuery.extend({
elem
.
style
[
name
]
=
options
[
name
];
elem
.
style
[
name
]
=
options
[
name
];
}
}
ret
=
callback
.
call
(
elem
);
ret
=
callback
.
apply
(
elem
,
args
||
[]
);
// Revert the old values
// Revert the old values
for
(
name
in
options
)
{
for
(
name
in
options
)
{
...
@@ -524,13 +524,11 @@ jQuery.each([ "height", "width" ], function( i, name ) {
...
@@ -524,13 +524,11 @@ jQuery.each([ "height", "width" ], function( i, name ) {
if
(
computed
)
{
if
(
computed
)
{
// certain elements can have dimension info if we invisibly show them
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
// however, it must have a current display style that would benefit from this
if
(
elem
.
offsetWidth
===
0
&&
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"display"
)
)
)
{
return
elem
.
offsetWidth
===
0
&&
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"display"
)
)
?
return
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
return
getWidthOrHeight
(
elem
,
name
,
extra
);
return
getWidthOrHeight
(
elem
,
name
,
extra
);
});
})
:
}
else
{
getWidthOrHeight
(
elem
,
name
,
extra
);
return
getWidthOrHeight
(
elem
,
name
,
extra
);
}
}
}
},
},
...
@@ -599,13 +597,12 @@ jQuery(function() {
...
@@ -599,13 +597,12 @@ jQuery(function() {
if
(
!
jQuery
.
support
.
reliableMarginRight
)
{
if
(
!
jQuery
.
support
.
reliableMarginRight
)
{
jQuery
.
cssHooks
.
marginRight
=
{
jQuery
.
cssHooks
.
marginRight
=
{
get
:
function
(
elem
,
computed
)
{
get
:
function
(
elem
,
computed
)
{
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if
(
computed
)
{
// Work around by temporarily setting element display to inline-block
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
return
jQuery
.
swap
(
elem
,
{
"display"
:
"inline-block"
},
function
()
{
// Work around by temporarily setting element display to inline-block
if
(
computed
)
{
return
jQuery
.
swap
(
elem
,
{
"display"
:
"inline-block"
},
return
curCSS
(
elem
,
"marginRight"
);
curCSS
,
[
elem
,
"marginRight"
]
);
}
}
});
}
}
};
};
}
}
...
@@ -617,11 +614,12 @@ jQuery(function() {
...
@@ -617,11 +614,12 @@ jQuery(function() {
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
cssHooks
[
prop
]
=
{
jQuery
.
cssHooks
[
prop
]
=
{
get
:
function
(
elem
,
computed
)
{
get
:
function
(
elem
,
computed
)
{
var
ret
;
if
(
computed
)
{
if
(
computed
)
{
ret
=
curCSS
(
elem
,
prop
);
computed
=
curCSS
(
elem
,
prop
);
// if curCSS returns percentage, fallback to offset
// if curCSS returns percentage, fallback to offset
return
rnumnonpx
.
test
(
ret
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
ret
;
return
rnumnonpx
.
test
(
computed
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
computed
;
}
}
}
}
};
};
...
@@ -649,10 +647,10 @@ jQuery.each({
...
@@ -649,10 +647,10 @@ jQuery.each({
jQuery
.
cssHooks
[
prefix
+
suffix
]
=
{
jQuery
.
cssHooks
[
prefix
+
suffix
]
=
{
expand
:
function
(
value
)
{
expand
:
function
(
value
)
{
var
i
=
0
,
var
i
=
0
,
expanded
=
{},
// assumes a single number if not a string
// assumes a single number if not a string
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
],
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
];
expanded
=
{};
for
(
;
i
<
4
;
i
++
)
{
for
(
;
i
<
4
;
i
++
)
{
expanded
[
prefix
+
cssExpand
[
i
]
+
suffix
]
=
expanded
[
prefix
+
cssExpand
[
i
]
+
suffix
]
=
...
...
src/manipulation.js
View file @
452e3276
...
@@ -283,9 +283,10 @@ jQuery.fn.extend({
...
@@ -283,9 +283,10 @@ jQuery.fn.extend({
// Flatten any nested arrays
// Flatten any nested arrays
args
=
core_concat
.
apply
(
[],
args
);
args
=
core_concat
.
apply
(
[],
args
);
var
fragment
,
first
,
scripts
,
hasScripts
,
iNoClone
,
node
,
doc
,
var
fragment
,
first
,
scripts
,
hasScripts
,
node
,
doc
,
i
=
0
,
i
=
0
,
l
=
this
.
length
,
l
=
this
.
length
,
iNoClone
=
l
-
1
,
value
=
args
[
0
],
value
=
args
[
0
],
isFunction
=
jQuery
.
isFunction
(
value
);
isFunction
=
jQuery
.
isFunction
(
value
);
...
@@ -317,7 +318,7 @@ jQuery.fn.extend({
...
@@ -317,7 +318,7 @@ jQuery.fn.extend({
// Use the original fragment for the last item instead of the first because it can end up
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
// being emptied incorrectly in certain situations (#8070).
for
(
iNoClone
=
l
-
1
;
i
<
l
;
i
++
)
{
for
(
;
i
<
l
;
i
++
)
{
node
=
fragment
;
node
=
fragment
;
if
(
i
!==
iNoClone
)
{
if
(
i
!==
iNoClone
)
{
...
@@ -514,13 +515,15 @@ jQuery.each({
...
@@ -514,13 +515,15 @@ jQuery.each({
insert
=
jQuery
(
selector
),
insert
=
jQuery
(
selector
),
last
=
insert
.
length
-
1
;
last
=
insert
.
length
-
1
;
for
(
;
i
<=
last
;
i
++
)
{
for
(
;
i
<=
last
;
i
++
)
{
elems
=
i
===
last
?
this
:
this
.
clone
(
true
);
elems
=
i
===
last
?
this
:
this
.
clone
(
true
);
jQuery
(
insert
[
i
]
)[
original
](
elems
);
jQuery
(
insert
[
i
]
)[
original
](
elems
);
core_push
.
apply
(
ret
,
elems
.
get
()
);
}
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
core_push
.
apply
(
ret
,
elems
.
get
()
);
}
return
this
.
pushStack
(
ret
);
return
this
.
pushStack
(
ret
);
};
};
});
});
...
@@ -610,9 +613,8 @@ jQuery.extend({
...
@@ -610,9 +613,8 @@ jQuery.extend({
},
},
clean
:
function
(
elems
,
context
,
fragment
,
scripts
,
selection
)
{
clean
:
function
(
elems
,
context
,
fragment
,
scripts
,
selection
)
{
var
elem
,
j
,
tmp
,
tag
,
wrap
,
tbody
,
var
elem
,
i
,
j
,
tmp
,
tag
,
wrap
,
tbody
,
ret
=
[],
ret
=
[],
i
=
0
,
safe
=
context
===
document
&&
safeFragment
;
safe
=
context
===
document
&&
safeFragment
;
// Ensure that context is a document
// Ensure that context is a document
...
@@ -706,7 +708,7 @@ jQuery.extend({
...
@@ -706,7 +708,7 @@ jQuery.extend({
// Append to fragment
// Append to fragment
// #4087 - If origin and destination elements are the same, and this is
// #4087 - If origin and destination elements are the same, and this is
// that element, do not append to fragment
// that element, do not append to fragment
if
(
!
(
selection
&&
jQuery
.
inArray
(
elem
,
selection
)
!==
-
1
)
)
{
if
(
!
selection
||
jQuery
.
inArray
(
elem
,
selection
)
===
-
1
)
{
fragment
.
appendChild
(
elem
);
fragment
.
appendChild
(
elem
);
}
}
tmp
=
getAll
(
elem
,
"script"
);
tmp
=
getAll
(
elem
,
"script"
);
...
...
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