fix: search
This commit is contained in:
@@ -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!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ document.addEventListener('keydown', (event)=>{
|
|||||||
let searchParam = params.get('s');
|
let searchParam = params.get('s');
|
||||||
if (searchParam){
|
if (searchParam){
|
||||||
searchInput.value = searchParam;
|
searchInput.value = searchParam;
|
||||||
|
console.log(searchParam);
|
||||||
search(searchParam);
|
search(searchParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,7 +22,8 @@ function submitSearch(event){
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
search();
|
search();
|
||||||
}
|
}
|
||||||
function search(searchStr = searchInput.value.toLowerCase()){
|
function search(searchStr = searchInput.value){
|
||||||
|
searchStr= searchStr.toLowerCase();
|
||||||
function showMatch(tr){
|
function showMatch(tr){
|
||||||
// match search with list
|
// match search with list
|
||||||
let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent.toLowerCase())
|
let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent.toLowerCase())
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ small{
|
|||||||
border-color: var(--bg-acc);
|
border-color: var(--bg-acc);
|
||||||
box-shadow: var(--bg-acc) 2px 2px;
|
box-shadow: var(--bg-acc) 2px 2px;
|
||||||
}
|
}
|
||||||
|
table, tr{
|
||||||
|
/* make table not resize when elements are hidden by searching */
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
th{
|
th{
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
@@ -65,6 +69,7 @@ a:hover, a:any-link{
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
.table-link{
|
.table-link{
|
||||||
|
/* TODO fix links with no title/content being almost unclickable */
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user