diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-09 14:38:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 14:38:13 +0200 |
commit | 3a5dfac12cf61d82b244026990b4d0f86d3b24b9 (patch) | |
tree | 13dda105ec0986278097519db0b102d2ea914cb6 /plugins/base/src/main/resources/dokka/scripts | |
parent | abe5113df0aeece35fc959e6b3b15ee125fe101c (diff) | |
download | dokka-3a5dfac12cf61d82b244026990b4d0f86d3b24b9.tar.gz dokka-3a5dfac12cf61d82b244026990b4d0f86d3b24b9.tar.bz2 dokka-3a5dfac12cf61d82b244026990b4d0f86d3b24b9.zip |
On this page component (#1504)
Diffstat (limited to 'plugins/base/src/main/resources/dokka/scripts')
-rw-r--r-- | plugins/base/src/main/resources/dokka/scripts/navigation-loader.js | 2 | ||||
-rw-r--r-- | plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js b/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js index c2f60ec5..0d9948ad 100644 --- a/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js +++ b/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js @@ -16,7 +16,7 @@ window.addEventListener('load', () => { }) /* Smooth scrolling support for going to the top of the page */ - document.querySelectorAll('a[href^="#"]').forEach(anchor => { + document.querySelectorAll('.footer a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); diff --git a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js index 022aca4f..26dd9424 100644 --- a/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js +++ b/plugins/base/src/main/resources/dokka/scripts/platform-content-handler.js @@ -114,6 +114,10 @@ function initializeFiltering() { let cached = window.localStorage.getItem('inactive-filters') if (cached) { let parsed = JSON.parse(cached) + //Events are used by react to get values in 'on this page' + const event = new CustomEvent('sourceset-filter-change', { detail: parsed }); + window.dispatchEvent(event); + filteringContext.activeFilters = filteringContext.restrictedDependencies .filter(q => parsed.indexOf(q) == -1 ) } else { @@ -215,6 +219,9 @@ function refreshFiltering() { elem.setAttribute("data-filterable-current", platformList.join(' ')) } ) + const event = new CustomEvent('sourceset-filter-change', { detail: sourcesetList }); + window.dispatchEvent(event); + refreshFilterButtons() refreshPlatformTabs() } |