Update RepoControls.plugin.js

This commit is contained in:
Mirco Wittrien 2019-01-07 13:04:20 +01:00
parent 953846cb27
commit b3c765c266
1 changed files with 2 additions and 3 deletions

View File

@ -336,9 +336,8 @@ class RepoControls {
}
changeTextToHTML (wrapper, searchstring) {
if (!wrapper || !wrapper.tagName) return;
if (typeof searchstring === "undefined") searchstring = document.querySelector(".repo-controls " + BDFDB.dotCN.searchbarinput).value.replace(/[<|>]/g, "").toUpperCase();
if (searchstring) wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription).forEach(ele => {
if (!wrapper || !wrapper.tagName || !searchstring) return;
wrapper.querySelectorAll(BDFDB.dotCNC._reponame + BDFDB.dotCNC._repoversion + BDFDB.dotCNC._repoauthor + BDFDB.dotCN._repodescription).forEach(ele => {
if (ele.classList.contains(BDFDB.disCN._repodescription)) ele.style.display = "block";
ele.innerHTML = BDFDB.highlightText(ele.innerText, searchstring);
});