Improved search

This commit is contained in:
2017-07-02 17:51:17 +02:00
parent 464a6ec26b
commit 326c4161aa
7 changed files with 43 additions and 14 deletions

View File

@ -145,10 +145,10 @@ export function search(arn: AnimeNotifier, search: HTMLInputElement, e: Keyboard
let term = search.value
if(!window.location.pathname.startsWith("/search/")) {
history.pushState("search", null, "/search/" + term)
} else {
if(window.location.pathname.startsWith("/search/")) {
history.replaceState("search", null, "/search/" + term)
} else {
history.pushState("search", null, "/search/" + term)
}
if(!term || term.length < 2) {
@ -165,7 +165,7 @@ export function search(arn: AnimeNotifier, search: HTMLInputElement, e: Keyboard
arn.app.content.appendChild(results)
}
arn.app.get("/_/search/" + encodeURI(term))
arn.app.get("/_/search/" + term)
.then(html => {
if(!search.value) {
return