mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Finishing the search engine.
This commit is contained in:
parent
23c7d72675
commit
492329149f
@ -54,7 +54,7 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
transition: width 0.4s ease-in-out;
|
transition: width 0.4s ease-in-out;
|
||||||
|
|
||||||
&:focus, .searching
|
&:focus, &.searching
|
||||||
{
|
{
|
||||||
width: 12rem;
|
width: 12rem;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export class AppComponent
|
|||||||
|
|
||||||
openSearch()
|
openSearch()
|
||||||
{
|
{
|
||||||
let input = <HTMLInputElement>document.getElementById("search");
|
let input: HTMLInputElement = <HTMLInputElement>document.getElementById("search");
|
||||||
|
|
||||||
input.value = "";
|
input.value = "";
|
||||||
input.focus();
|
input.focus();
|
||||||
@ -53,9 +53,15 @@ export class AppComponent
|
|||||||
{
|
{
|
||||||
let query: string = event.target.value;
|
let query: string = event.target.value;
|
||||||
if (query != "")
|
if (query != "")
|
||||||
|
{
|
||||||
|
event.target.classList.add("searching");
|
||||||
this.router.navigate(["/search/" + query], { replaceUrl: this.router.url.startsWith("/search/") });
|
this.router.navigate(["/search/" + query], { replaceUrl: this.router.url.startsWith("/search/") });
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
event.target.classList.remove("searching");
|
||||||
this.location.back();
|
this.location.back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,4 +22,11 @@ export class SearchComponent implements OnInit
|
|||||||
this.title.setTitle(this.items.query + " - Kyoo");
|
this.title.setTitle(this.items.query + " - Kyoo");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit()
|
||||||
|
{
|
||||||
|
let searchBar: HTMLInputElement = <HTMLInputElement>document.getElementById("search");
|
||||||
|
searchBar.classList.add("searching");
|
||||||
|
searchBar.value = this.items.query;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user