From b7d7f44c2538036c67e18197b8f3278e4d482eaa Mon Sep 17 00:00:00 2001 From: Yuri Teplyakov Date: Thu, 21 Nov 2024 21:15:18 +0100 Subject: [PATCH] ktl-1758 fix: fix filter notification duplication --- .../dokka/scripts/platform-content-handler.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/platform-content-handler.js b/dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/platform-content-handler.js index d1f4c13cd0..118de3848a 100644 --- a/dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/platform-content-handler.js +++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/scripts/platform-content-handler.js @@ -313,14 +313,18 @@ function refreshPlaygroundSamples() { function refreshNoContentNotification() { const element = document.getElementsByClassName("main-content")[0] + const filteredMessage = document.querySelector(".filtered-message") + if(filteringContext.activeFilters.length === 0){ element.style.display = "none"; - const appended = document.createElement("div") - appended.className = "filtered-message" - appended.innerText = "All documentation is filtered, please adjust your source set filters in top-right corner of the screen" - sourcesetNotification = appended - element.parentNode.prepend(appended) + if (!filteredMessage) { + const appended = document.createElement("div") + appended.className = "filtered-message" + appended.innerText = "All documentation is filtered, please adjust your source set filters in top-right corner of the screen" + sourcesetNotification = appended + element.parentNode.prepend(appended) + } } else { if(sourcesetNotification) sourcesetNotification.remove() element.style.display = "block"