aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2020-07-21 14:24:05 +0200
committerGitHub <noreply@github.com>2020-07-21 14:24:05 +0200
commit185f7e26edff82460793e1065888e49c5df34512 (patch)
treeb1975399903a2bfe6c483593741745707d2167bb /plugins/base
parentf39971875c4f7d98dc1add2a8ed949d22b25600b (diff)
downloaddokka-185f7e26edff82460793e1065888e49c5df34512.tar.gz
dokka-185f7e26edff82460793e1065888e49c5df34512.tar.bz2
dokka-185f7e26edff82460793e1065888e49c5df34512.zip
Allow anchors to redirect user without refresh (#1187)
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js b/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js
index 6f10b08a..f0e08f48 100644
--- a/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js
+++ b/plugins/base/src/main/resources/dokka/scripts/platformContentHandler.js
@@ -17,6 +17,10 @@ window.addEventListener('load', () => {
handleAnchor()
})
+// Hash change is needed in order to allow for linking inside the same page with anchors
+// If this is not present user is forced to refresh the site in order to use an anchor
+window.onhashchange = handleAnchor
+
function handleAnchor() {
let searchForTab = function(element) {
if(element && element.hasAttribute) {