Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
ea70cf5a
Commit
ea70cf5a
authored
May 08, 2018
by
杨奕
Committed by
GitHub
May 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Utils: scroll-into-view should consider target element's offset parents (#11058)
parent
71a66ae2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
build/deploy-ci.sh
build/deploy-ci.sh
+1
-1
build/deploy-faas.sh
build/deploy-faas.sh
+1
-1
src/utils/scroll-into-view.js
src/utils/scroll-into-view.js
+8
-2
No files found.
build/deploy-ci.sh
View file @
ea70cf5a
...
@@ -36,7 +36,7 @@ if [ "$TRAVIS_TAG" ]; then
...
@@ -36,7 +36,7 @@ if [ "$TRAVIS_TAG" ]; then
# build site
# build site
npm run deploy:build
npm run deploy:build
cd
temp_web
cd
temp_web
git clone
-
b
gh-pages
https://
$ROT_TOKEN
@github.com/ElemeFE/element.git
&&
cd
element
git clone
-
-depth
1
-b
gh-pages
--single-branch
https://
$ROT_TOKEN
@github.com/ElemeFE/element.git
&&
cd
element
# build sub folder
# build sub folder
echo
$TRAVIS_TAG
echo
$TRAVIS_TAG
...
...
build/deploy-faas.sh
View file @
ea70cf5a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
mkdir
temp_web
mkdir
temp_web
npm run deploy:build
npm run deploy:build
cd
temp_web
cd
temp_web
git clone
-
b
gh-pages
https://github.com/ElemeFE/element.git
&&
cd
element
git clone
-
-depth
1
-b
gh-pages
--single-branch
https://github.com/ElemeFE/element.git
&&
cd
element
# build sub folder
# build sub folder
SUB_FOLDER
=
'2.3'
SUB_FOLDER
=
'2.3'
...
...
src/utils/scroll-into-view.js
View file @
ea70cf5a
...
@@ -8,8 +8,14 @@ export default function scrollIntoView(container, selected) {
...
@@ -8,8 +8,14 @@ export default function scrollIntoView(container, selected) {
return
;
return
;
}
}
const
top
=
selected
.
offsetTop
;
const
offsetParents
=
[];
const
bottom
=
selected
.
offsetTop
+
selected
.
offsetHeight
;
let
pointer
=
selected
.
offsetParent
;
while
(
pointer
&&
container
!==
pointer
&&
container
.
contains
(
pointer
))
{
offsetParents
.
push
(
pointer
);
pointer
=
pointer
.
offsetParent
;
}
const
top
=
selected
.
offsetTop
+
offsetParents
.
reduce
((
prev
,
curr
)
=>
(
prev
+
curr
.
offsetTop
),
0
);
const
bottom
=
top
+
selected
.
offsetHeight
;
const
viewRectTop
=
container
.
scrollTop
;
const
viewRectTop
=
container
.
scrollTop
;
const
viewRectBottom
=
viewRectTop
+
container
.
clientHeight
;
const
viewRectBottom
=
viewRectTop
+
container
.
clientHeight
;
...
...
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