Browse Source

remove the filter search code from main.js file.

I moved it to filter-serach.js in a previous commit. This commit just gets rid
of it in the main.js file.
stable
Craig Oates 1 year ago
parent
commit
08a0a06152
  1. 20
      static/js/main.js

20
static/js/main.js

@ -11,26 +11,6 @@ function closeAlert() {
document.getElementById("be-alert-container").style.display = "none";
}
window.addEventListener("load", () => {
// (A) GET HTML ELEMENTS
var filter = document.getElementById("fe-search-filter"), // search box
list = document.querySelectorAll("#fe-search-filter-list li"); // all list items
// (B) ATTACH KEY UP LISTENER TO SEARCH BOX
filter.onkeyup = () => {
// (B1) GET CURRENT SEARCH TERM
let search = filter.value.toLowerCase();
// (B2) LOOP THROUGH LIST ITEMS - ONLY SHOW THOSE THAT MATCH SEARCH
for (let i of list) {
let item = i.innerHTML.toLowerCase();
if (item.indexOf(search) == -1) { i.classList.add("hide"); }
else { i.classList.remove("hide"); }
}
};
});
function copyToClipBoard (slug) {
let URL = location.protocol + "//" + location.host + "/storage/view/media/" + slug;
let popup = document.getElementById(slug + "-popup");

Loading…
Cancel
Save