Skip to content

Commit

Permalink
ktl-1758 fix: fix filter notification duplication (#3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
krutilov authored and berezinant committed Dec 2, 2024
1 parent b654529 commit e30104e
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 e30104e

Please sign in to comment.