Disabled datalist (too many entries displayed, bad UI)

This commit is contained in:
Eduard Urbach 2017-11-16 16:56:34 +01:00
parent 0d0ae75bd4
commit 3d53dc7cb4
2 changed files with 19 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package popular
import (
"net/http"
"strings"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
@ -25,7 +24,7 @@ func AnimeTitles(ctx *aero.Context) string {
}
for _, anime := range popularAnime {
popularAnimeTitles = append(popularAnimeTitles, strings.ToLower(anime.Title.Canonical))
popularAnimeTitles = append(popularAnimeTitles, anime.Title.Canonical)
if arn.ContainsUnicodeLetters(anime.Title.Japanese) {
popularAnimeTitles = append(popularAnimeTitles, anime.Title.Japanese)

View File

@ -164,7 +164,7 @@ export class AnimeNotifier {
}
}
onIdle() {
async onIdle() {
// Service worker
this.serviceWorkerManager = new ServiceWorkerManager(this, "/service-worker")
this.serviceWorkerManager.register()
@ -178,6 +178,23 @@ export class AnimeNotifier {
if(navigator.onLine === false) {
this.statusMessage.showError("You are viewing an offline version of the site now.")
}
// Download popular anime titles for the search
// let response = await fetch("/api/popular/anime/titles/500")
// let titles = await response.json()
// let titleList = document.createElement("datalist")
// titleList.id = "popular-anime-titles-list"
// for(let title of titles) {
// let option = document.createElement("option")
// option.value = title
// titleList.appendChild(option)
// }
// document.body.appendChild(titleList)
// let search = this.app.find("search") as HTMLInputElement
// search.setAttribute("list", titleList.id)
}
dragAndDrop() {