clear timeout for setting live leaf class
parent
935e806de2
commit
d8ec52d8d8
|
|
@ -200,7 +200,7 @@
|
||||||
//drawFile(id)
|
//drawFile(id)
|
||||||
document.getElementById("saveFeedback").innerHTML = "success!"
|
document.getElementById("saveFeedback").innerHTML = "success!"
|
||||||
if (saveFeedbackInterval) {
|
if (saveFeedbackInterval) {
|
||||||
clearInterval(saveFeedbackInterval)
|
clearTimeout(saveFeedbackInterval)
|
||||||
}
|
}
|
||||||
saveFeedbackInterval = setTimeout(() => {document.getElementById("saveFeedback").innerHTML = ""}, 5000)
|
saveFeedbackInterval = setTimeout(() => {document.getElementById("saveFeedback").innerHTML = ""}, 5000)
|
||||||
}, body, headers)
|
}, body, headers)
|
||||||
|
|
@ -236,6 +236,8 @@
|
||||||
document.getElementById("searchResults").className = "";
|
document.getElementById("searchResults").className = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var liveLeafTimeout = null
|
||||||
|
|
||||||
function setMDE(id, title, body) {
|
function setMDE(id, title, body) {
|
||||||
if (id[0] == "/")
|
if (id[0] == "/")
|
||||||
id = id.slice(1, id.length)
|
id = id.slice(1, id.length)
|
||||||
|
|
@ -265,7 +267,9 @@
|
||||||
for (var i in previouslyHighlighted)
|
for (var i in previouslyHighlighted)
|
||||||
if (previouslyHighlighted && previouslyHighlighted[i] && previouslyHighlighted[i].classList)
|
if (previouslyHighlighted && previouslyHighlighted[i] && previouslyHighlighted[i].classList)
|
||||||
previouslyHighlighted[i].classList.remove("live_leaf")
|
previouslyHighlighted[i].classList.remove("live_leaf")
|
||||||
setTimeout(() => {
|
if (liveLeafTimeout)
|
||||||
|
clearTimeout(liveLeafTimeout)
|
||||||
|
liveLeafTimeout = setTimeout(() => {
|
||||||
const toHighlight = document.getElementsByClassName(btoa("/"+id))
|
const toHighlight = document.getElementsByClassName(btoa("/"+id))
|
||||||
for (var i = 0; i < toHighlight.length; i++) {
|
for (var i = 0; i < toHighlight.length; i++) {
|
||||||
if (toHighlight && toHighlight[i] && toHighlight[i].classList)
|
if (toHighlight && toHighlight[i] && toHighlight[i].classList)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue