From: Dan Allen Date: Mon, 21 Dec 2020 00:00:22 +0000 (-0700) Subject: consolidate code in fragment jumper X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=27c4a4f72b8af80c8a6a7ee36d2c5c6ce46ce33c;p=working%2Feg-antora.git consolidate code in fragment jumper --- diff --git a/src/js/03-fragment-jumper.js b/src/js/03-fragment-jumper.js index 5f9462a..68f580d 100644 --- 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) {