diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-07-21 14:24:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-21 14:24:05 +0200 |
commit | 185f7e26edff82460793e1065888e49c5df34512 (patch) | |
tree | b1975399903a2bfe6c483593741745707d2167bb /plugins/base | |
parent | f39971875c4f7d98dc1add2a8ed949d22b25600b (diff) | |
download | dokka-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.js | 4 |
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) { |