diff --git a/website/maloja.css b/website/maloja.css index f2efad6..0edbeb6 100644 --- a/website/maloja.css +++ b/website/maloja.css @@ -64,7 +64,7 @@ div.footer { left:0px; right:0px; padding:10px; - opacity:0.8; + opacity:1; } div.footer div:nth-child(1) { @@ -129,6 +129,7 @@ div.searchresults>span { div.searchresults table { width:100%; + border-spacing:0px 4px; } div.searchresults tr { @@ -150,9 +151,8 @@ div.searchresults tr td.image { background-position:center; } -div.searchresults tr td.info { - height:50px; - width:350px; +div.searchresults tr td:nth-child(2) { + padding-left:10px; } div.searchresults table.searchresults_tracks td span:nth-child(1) { diff --git a/website/start.html b/website/start.html index 51dc42f..c11d588 100644 --- a/website/start.html +++ b/website/start.html @@ -52,14 +52,19 @@ function search(searchfield) { txt = searchfield.value; - xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = searchresult - xhttp.open("GET","/db/search?query=" + txt, true); - xhttp.send(); + if (txt == "") { + reallyclear() + } + else { + xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = searchresult + xhttp.open("GET","/db/search?query=" + txt, true); + xhttp.send(); + } } function searchresult() { - if (this.readyState == 4 && this.status == 200) { - + if (this.readyState == 4 && this.status == 200 && document.getElementById("searchinput").value != "") { + // checking if field is empty in case we get an old result coming in that would overwrite our cleared result window result = JSON.parse(this.responseText); artists = result["artists"].slice(0,5) tracks = result["tracks"].slice(0,5) @@ -219,11 +224,15 @@ Maloja