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
6987220d
Commit
6987220d
authored
Sep 06, 2013
by
Michał Gołębiowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket. Optimize top/left hooks: move the position check up, don't re-check it inside a hook.
parent
3ec6af89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
css.js
src/css.js
+8
-10
No files found.
src/css.js
View file @
6987220d
...
@@ -589,15 +589,14 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
...
@@ -589,15 +589,14 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
return
;
return
;
}
}
if
(
pixelPosition
)
{
if
(
pixelPosition
||
!
jQuery
.
fn
.
position
)
{
// Hook not needed, remove it.
// Hook not needed
or impossible to apply due to a missing module
, remove it.
// Since there are no other hooks for prop, remove the whole object.
// Since there are no other hooks for prop, remove the whole object.
delete
jQuery
.
cssHooks
[
prop
];
delete
jQuery
.
cssHooks
[
prop
];
return
;
return
;
}
}
jQuery
.
cssHooks
[
prop
].
get
=
function
(
elem
,
computed
)
{
jQuery
.
cssHooks
[
prop
].
get
=
function
(
elem
,
computed
)
{
if
(
!
support
.
pixelPosition
()
&&
jQuery
.
fn
.
position
)
{
if
(
computed
)
{
if
(
computed
)
{
computed
=
curCSS
(
elem
,
prop
);
computed
=
curCSS
(
elem
,
prop
);
// if curCSS returns percentage, fallback to offset
// if curCSS returns percentage, fallback to offset
...
@@ -605,7 +604,6 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
...
@@ -605,7 +604,6 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
computed
;
computed
;
}
}
}
};
};
return
jQuery
.
cssHooks
[
prop
].
get
(
elem
,
computed
);
return
jQuery
.
cssHooks
[
prop
].
get
(
elem
,
computed
);
...
...
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