Commit 0a986655 authored by Athanasios's avatar Athanasios
Browse files

Restore search function

parent 763151c7
......@@ -81,20 +81,22 @@ html(lang="de")
var filter = input.value.toUpperCase()
var cardsCol = document.getElementsByClassName("col-sm")
var cardTitle, cardText, titleValue, textValue
var cardTitle, cardBadges, cardText, titleValue, badgesValue, textValue, allValues;
var i
var counterBlock = 0
for (i = 0; i < cardsCol.length; i++) {
cardTitle = cardsCol[i].getElementsByClassName("card-title-bottom-left");
cardBody = cardsCol[i].getElementsByClassName("card-body");
//cardBody = cardsCol[i].getElementsByClassName("card-body");
cardBadges = [...cardsCol[i].getElementsByClassName("badge-pill")];
cardText = cardsCol[i].getElementsByClassName("card-text");
titleValue = cardTitle[0].textContent || cardTitle[0].innerText;
bodyValue = cardBody[0].textContent || cardBody[0].innerText;
badgesValue = cardBadges.map(b => b.textContent).join(" ");
//bodyValue = cardBody[0].textContent || cardBody[0].innerText;
textValue = cardText[0].textContent || cardText[0].innerText;
if (titleValue.toUpperCase().indexOf(filter) > -1 || bodyValue.toUpperCase().indexOf(filter) > -1 || textValue.toUpperCase().indexOf(filter) > -1) {
allValues = [titleValue, badgesValue, textValue].map(v => v.toUpperCase()).join(" ");
if (allValues.indexOf(filter)!= -1) {
cardsCol[i].style.display = "block"
counterBlock++
} else {
......
......@@ -105,20 +105,22 @@ html(lang="de")
var filter = input.value.toUpperCase()
var cardsCol = document.getElementsByClassName("col-sm")
var cardTitle, cardText, titleValue, textValue
var cardTitle, cardBadges, cardText, titleValue, badgesValue, textValue, allValues;
var i
var counterBlock = 0
for (i = 0; i < cardsCol.length; i++) {
cardTitle = cardsCol[i].getElementsByClassName("card-title-bottom-left");
cardBody = cardsCol[i].getElementsByClassName("card-body");
//cardBody = cardsCol[i].getElementsByClassName("card-body");
cardBadges = [...cardsCol[i].getElementsByClassName("badge-pill")];
cardText = cardsCol[i].getElementsByClassName("card-text");
titleValue = cardTitle[0].textContent || cardTitle[0].innerText;
bodyValue = cardBody[0].textContent || cardBody[0].innerText;
badgesValue = cardBadges.map(b => b.textContent).join(" ");
//bodyValue = cardBody[0].textContent || cardBody[0].innerText;
textValue = cardText[0].textContent || cardText[0].innerText;
if (titleValue.toUpperCase().indexOf(filter) > -1 || bodyValue.toUpperCase().indexOf(filter) > -1 || textValue.toUpperCase().indexOf(filter) > -1) {
allValues = [titleValue, badgesValue, textValue].map(v => v.toUpperCase()).join(" ");
if (allValues.indexOf(filter)!= -1) {
cardsCol[i].style.display = "block"
counterBlock++
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment