mobile swipe support on tabs

This commit is contained in:
Daan 2020-09-16 08:41:46 +02:00
parent 970fdd3eb8
commit 1c8289df0e
3 changed files with 13 additions and 9 deletions

View file

@ -20,18 +20,19 @@
<perfect-scrollbar> <perfect-scrollbar>
<v-tabs-items <v-tabs-items
v-model="tab" v-model="tab"
touchless :touch="updateTab(tab)"
:style="{ maxHeight: dialogHeight }" :style="{ maxHeight: dialogHeight }"
> >
<v-tab-item value="webui"> <v-tab-item value="downloads">
<WebUI :is-active="tab === 'webui'" /> <Downloads :is-active="tab === 'downloads'" />
</v-tab-item> </v-tab-item>
<v-tab-item value="bittorrent"> <v-tab-item value="bittorrent">
<BitTorrent :is-active="tab === 'bittorrent'" /> <BitTorrent :is-active="tab === 'bittorrent'" />
</v-tab-item> </v-tab-item>
<v-tab-item value="downloads"> <v-tab-item value="webui">
<Downloads :is-active="tab === 'downloads'" /> <WebUI :is-active="tab === 'webui'" />
</v-tab-item> </v-tab-item>
<v-tab-item value="vuetorrent"> <v-tab-item value="vuetorrent">
<VueTorrent :is-active="tab === 'vuetorrent'" /> <VueTorrent :is-active="tab === 'vuetorrent'" />
</v-tab-item> </v-tab-item>

View file

@ -23,19 +23,19 @@
<v-tab href="#content">Content</v-tab> <v-tab href="#content">Content</v-tab>
<v-tab href="#tagsAndCategories">Tags & Categories</v-tab> <v-tab href="#tagsAndCategories">Tags & Categories</v-tab>
</v-tabs> </v-tabs>
<v-tabs-items v-model="tab" touchless> <v-tabs-items v-model="tab" :touch="updateTab(tab)">
<v-tab-item value="info"> <v-tab-item value="info">
<info :is-active="tab === 'info'" :hash="hash" /> <info :is-active="tab === 'info'" :hash="hash" />
</v-tab-item> </v-tab-item>
<v-tab-item value="peers">
<Peers :is-active="tab === 'peers'" :hash="hash" />
</v-tab-item>
<v-tab-item value="trackers"> <v-tab-item value="trackers">
<Trackers <Trackers
:is-active="tab === 'trackers'" :is-active="tab === 'trackers'"
:hash="hash" :hash="hash"
/> />
</v-tab-item> </v-tab-item>
<v-tab-item value="peers">
<Peers :is-active="tab === 'peers'" :hash="hash" />
</v-tab-item>
<v-tab-item value="content"> <v-tab-item value="content">
<Content :is-active="tab === 'content'" :hash="hash" /> <Content :is-active="tab === 'content'" :hash="hash" />
</v-tab-item> </v-tab-item>

View file

@ -15,6 +15,9 @@ export default {
methods: { methods: {
deleteModal() { deleteModal() {
setTimeout(() => this.$store.commit('DELETE_MODAL', this.guid), 100) setTimeout(() => this.$store.commit('DELETE_MODAL', this.guid), 100)
},
updateTab(tab) {
this.tab = tab
} }
}, },
beforeDestroy() { beforeDestroy() {