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 Nov 25, 2024
1 parent ab756ea commit 7c434b8
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 7c434b8

Please sign in to comment.