mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Update search text with search query
This commit is contained in:
parent
8fe663da80
commit
475f645a1e
1 changed files with 10 additions and 2 deletions
|
@ -152,14 +152,22 @@ export default {
|
||||||
return _this.getPreferenceBoolean("searchHistory", false) && localStorage.getItem("search_history");
|
return _this.getPreferenceBoolean("searchHistory", false) && localStorage.getItem("search_history");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
$route() {
|
||||||
|
this.updateSearchTextFromURLSearchParams();
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchAuthConfig();
|
this.fetchAuthConfig();
|
||||||
const query = new URLSearchParams(window.location.search).get("search_query");
|
this.updateSearchTextFromURLSearchParams();
|
||||||
if (query) this.onSearchTextChange(query);
|
|
||||||
this.focusOnSearchBar();
|
this.focusOnSearchBar();
|
||||||
this.homePagePath = this.getHomePage(this);
|
this.homePagePath = this.getHomePage(this);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateSearchTextFromURLSearchParams() {
|
||||||
|
const query = new URLSearchParams(window.location.search).get("search_query");
|
||||||
|
if (query) this.onSearchTextChange(query);
|
||||||
|
},
|
||||||
// focus on search bar when Ctrl+k is pressed
|
// focus on search bar when Ctrl+k is pressed
|
||||||
focusOnSearchBar() {
|
focusOnSearchBar() {
|
||||||
hotkeys("ctrl+k", event => {
|
hotkeys("ctrl+k", event => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue