added tags

This commit is contained in:
DerTyp187
2021-11-11 18:40:50 +01:00
parent faef6f16ba
commit 43eac1907d
4 changed files with 29 additions and 7 deletions

View File

@@ -19,6 +19,7 @@
<div class="list-item" onclick="openTopic('{{ topic.title }}')">
<!--<img src="c_icon.png"/>-->
<p>{{ topic.title }}</p>
<small style="display:none;">{{ topic.tags }}</small>
</div>
{% endfor %}
@@ -33,10 +34,12 @@
for (let index = 0; index < items.length; index++) {
const item = items[index];
const p = item.getElementsByTagName("p")[0];
item.style.display = "none";
const tags = item.getElementsByTagName("small")[0].innerHTML;
var value = input.value.toLowerCase().replace(".", "").replace(";", "").replace(",", "").replace(" ", "")
if(p.innerHTML.toLowerCase().includes(input.value.toLowerCase())){
item.style.display = "none";
if(p.innerHTML.toLowerCase().includes(value) || tags.toLowerCase().includes(value)){
item.style.display = "block";
}