fix: search

This commit is contained in:
eneller
2025-03-20 21:46:53 +01:00
parent c1f813d70c
commit c728f65e73
3 changed files with 9 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ SECRET_KEY = "django-insecure-^@m5bl*8x+=@c^b0lhkgb-%_#9#&oad=v15jq=!0$g#x17zjf8
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']
# Application definition

View File

@@ -14,6 +14,7 @@ document.addEventListener('keydown', (event)=>{
let searchParam = params.get('s');
if (searchParam){
searchInput.value = searchParam;
console.log(searchParam);
search(searchParam);
}
@@ -21,7 +22,8 @@ function submitSearch(event){
event.preventDefault();
search();
}
function search(searchStr = searchInput.value.toLowerCase()){
function search(searchStr = searchInput.value){
searchStr= searchStr.toLowerCase();
function showMatch(tr){
// match search with list
let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent.toLowerCase())

View File

@@ -42,6 +42,10 @@ small{
border-color: var(--bg-acc);
box-shadow: var(--bg-acc) 2px 2px;
}
table, tr{
/* make table not resize when elements are hidden by searching */
width: 100%;
}
th{
text-align: left;
}
@@ -65,6 +69,7 @@ a:hover, a:any-link{
color: inherit;
}
.table-link{
/* TODO fix links with no title/content being almost unclickable */
display: block;
width: 100%;
height: 100%;