projects
/
working
/
eg-antora.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
805c1f6
)
consolidate code in fragment jumper
author
Dan Allen
<dan@opendevise.com>
Mon, 21 Dec 2020 00:00:22 +0000
(17:00 -0700)
committer
Dan Allen
<dan@opendevise.com>
Mon, 21 Dec 2020 00:00:22 +0000
(17:00 -0700)
src/js/03-fragment-jumper.js
patch
|
blob
|
history
diff --git
a/src/js/03-fragment-jumper.js
b/src/js/03-fragment-jumper.js
index
5f9462a
..
68f580d
100644
(file)
--- a/
src/js/03-fragment-jumper.js
+++ b/
src/js/03-fragment-jumper.js
@@
-9,11
+9,7
@@
}
function computePosition (el, sum) {
- if (article.contains(el)) {
- return computePosition(el.offsetParent, el.offsetTop + sum)
- } else {
- return sum
- }
+ return article.contains(el) ? computePosition(el.offsetParent, el.offsetTop + sum) : sum
}
function jumpToAnchor (e) {