forked from platypush/platypush
[Media UI] Don't display the torrent menu entry if no torrent plugin is enabled.
This commit is contained in:
parent
5ef7313bdc
commit
deaedf2462
2 changed files with 19 additions and 3 deletions
|
@ -8,7 +8,9 @@
|
||||||
@seek="seek" @search="search" @mute="toggleMute" @unmute="toggleMute">
|
@seek="seek" @search="search" @mute="toggleMute" @unmute="toggleMute">
|
||||||
<main>
|
<main>
|
||||||
<div class="nav-container from tablet" :style="navContainerStyle">
|
<div class="nav-container from tablet" :style="navContainerStyle">
|
||||||
<Nav :selected-view="selectedView" @input="selectedView = $event"
|
<Nav :selected-view="selectedView"
|
||||||
|
:torrent-plugin="torrentPlugin"
|
||||||
|
@input="selectedView = $event"
|
||||||
@toggle="forceShowNav = !forceShowNav" />
|
@toggle="forceShowNav = !forceShowNav" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<i class="fa fa-bars" />
|
<i class="fa fa-bars" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<li v-for="(view, name) in views" :key="name" :title="view.displayName"
|
<li v-for="(view, name) in displayedViews" :key="name" :title="view.displayName"
|
||||||
:class="{selected: name === selectedView}" @click="$emit('input', name)">
|
:class="{selected: name === selectedView}" @click="$emit('input', name)">
|
||||||
<i :class="view.iconClass" />
|
<i :class="view.iconClass" />
|
||||||
</li>
|
</li>
|
||||||
|
@ -24,6 +24,10 @@ export default {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
torrentPlugin: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
|
||||||
views: {
|
views: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
|
@ -46,6 +50,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
displayedViews() {
|
||||||
|
const views = {...this.views}
|
||||||
|
if (!this.torrentPlugin?.length)
|
||||||
|
delete views.torrents
|
||||||
|
|
||||||
|
return views
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue