From 185f7e26edff82460793e1065888e49c5df34512 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Tue, 21 Jul 2020 14:24:05 +0200 Subject: Allow anchors to redirect user without refresh (#1187) --- .../base/src/main/resources/dokka/scripts/platformContentHandler.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/base/src/main') 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) { -- cgit