Handschriftenseite

This commit is contained in:
Simon Martens
2023-02-03 20:12:31 +01:00
parent 9f2e387c29
commit 41de6530c7
4 changed files with 57 additions and 12 deletions

View File

@@ -85,9 +85,9 @@
// Scripts for filtering lists
let dictionary = [];
function createIndex(id){
$("#" + id + " .searchable").each( (ind, el) => {
function createIndex(id, searchable){
$("#" + id + " " + searchable).each( (ind, el) => {
dictionary.push({
category: $(el).parents(".category"),
element: el,
@@ -121,7 +121,13 @@
// List filtering
if (document.getElementById("list")) {
createIndex("list");
var searchable = "";
if (document.getElementsByClassName("searchable").length > 0) {
searchable = ".searchable";
} else if (document.getElementsByClassName("handschrift").length > 0) {
searchable = ".handschrift";
}
createIndex("list", searchable);
let found = dictionary;
let sw = "";
let swl = 0;
@@ -134,6 +140,10 @@
$(".hideifsearching").each( (ind, el) => {
$(el).hide();
});
$(".ueberschrift-gruppe").each( (ind, el) => {
$(el).hide();
});
// Unmark everything previously marked
if (sw.length > 0) {
@@ -177,7 +187,7 @@
else {
$("#list .category").show().removeClass("search-expanded").unmark();
$("#list .searchable").show();
$("#list " + searchable).show();
found = dictionary;
sw = "";
swl = 0;