Skip to content

Commit

Permalink
ktl-1758 fix: fix filter notification duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
krutilov committed Nov 21, 2024
1 parent 7361d4c commit b7d7f44
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b7d7f44

Please sign in to comment.