mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-09 12:48:09 -05:00
[web-src] Search tab buttons now trigger search
This commit is contained in:
parent
ee6419041a
commit
cbfea854d2
@ -5,18 +5,18 @@
|
|||||||
<div class="column is-four-fifths">
|
<div class="column is-four-fifths">
|
||||||
<div class="tabs is-centered is-small is-toggle is-toggle-rounded">
|
<div class="tabs is-centered is-small is-toggle is-toggle-rounded">
|
||||||
<ul>
|
<ul>
|
||||||
<router-link tag="li" :to="{ path: '/search/library', query: $route.query }" active-class="is-active">
|
<li :class="{ 'is-active': $route.path === '/search/library' }">
|
||||||
<a>
|
<a @click="search_library">
|
||||||
<span class="icon is-small"><i class="mdi mdi-library-books"></i></span>
|
<span class="icon is-small"><i class="mdi mdi-library-books"></i></span>
|
||||||
<span class="">Library</span>
|
<span class="">Library</span>
|
||||||
</a>
|
</a>
|
||||||
</router-link>
|
</li>
|
||||||
<router-link tag="li" :to="{ path: '/search/spotify', query: $route.query }" active-class="is-active">
|
<li :class="{ 'is-active': $route.path === '/search/spotify' }">
|
||||||
<a>
|
<a @click="search_spotify">
|
||||||
<span class="icon is-small"><i class="mdi mdi-spotify"></i></span>
|
<span class="icon is-small"><i class="mdi mdi-spotify"></i></span>
|
||||||
<span class="">Spotify</span>
|
<span class="">Spotify</span>
|
||||||
</a>
|
</a>
|
||||||
</router-link>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -29,10 +29,46 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'TabsSearch',
|
name: 'TabsSearch',
|
||||||
|
|
||||||
|
props: ['query'],
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
spotify_enabled () {
|
spotify_enabled () {
|
||||||
return this.$store.state.spotify.webapi_token_valid
|
return this.$store.state.spotify.webapi_token_valid
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
search_library: function () {
|
||||||
|
if (!this.query) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$router.push({
|
||||||
|
path: '/search/library',
|
||||||
|
query: {
|
||||||
|
type: 'track,artist,album,playlist,audiobook,podcast',
|
||||||
|
query: this.query,
|
||||||
|
limit: 3,
|
||||||
|
offset: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
search_spotify: function () {
|
||||||
|
if (!this.query) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$router.push({
|
||||||
|
path: '/search/spotify',
|
||||||
|
query: {
|
||||||
|
type: 'track,artist,album,playlist,audiobook,podcast',
|
||||||
|
query: this.query,
|
||||||
|
limit: 3,
|
||||||
|
offset: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<tabs-search></tabs-search>
|
<tabs-search :query="search_query"></tabs-search>
|
||||||
|
|
||||||
<!-- Tracks -->
|
<!-- Tracks -->
|
||||||
<content-with-heading v-if="show_tracks && tracks.total">
|
<content-with-heading v-if="show_tracks && tracks.total">
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<tabs-search></tabs-search>
|
<tabs-search :query="search_query"></tabs-search>
|
||||||
|
|
||||||
<!-- Tracks -->
|
<!-- Tracks -->
|
||||||
<content-with-heading v-if="show_tracks && tracks.total">
|
<content-with-heading v-if="show_tracks && tracks.total">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user