forked from platypush/platypush
[Media UI] Added media view to URL fragment.
This commit is contained in:
parent
e180c9c76f
commit
a746273f73
2 changed files with 23 additions and 5 deletions
|
@ -19,7 +19,7 @@
|
||||||
<Nav :selected-view="selectedView"
|
<Nav :selected-view="selectedView"
|
||||||
:torrent-plugin="torrentPlugin"
|
:torrent-plugin="torrentPlugin"
|
||||||
:download-icon-class="downloadIconClass"
|
:download-icon-class="downloadIconClass"
|
||||||
@input="onNavInput"
|
@input="setView"
|
||||||
@toggle="forceShowNav = !forceShowNav"
|
@toggle="forceShowNav = !forceShowNav"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -544,13 +544,20 @@ export default {
|
||||||
}, {})
|
}, {})
|
||||||
},
|
},
|
||||||
|
|
||||||
onNavInput(event) {
|
setView(title) {
|
||||||
this.selectedView = event
|
this.selectedView = title
|
||||||
if (event === 'search') {
|
if (title === 'search') {
|
||||||
this.selectedResult = null
|
this.selectedResult = null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateView() {
|
||||||
|
const args = this.getUrlArgs()
|
||||||
|
if (args.view) {
|
||||||
|
this.selectedView = args.view
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onDownloadStarted(event) {
|
onDownloadStarted(event) {
|
||||||
this.downloads[event.path] = event
|
this.downloads[event.path] = event
|
||||||
this.notify({
|
this.notify({
|
||||||
|
@ -679,6 +686,7 @@ export default {
|
||||||
this.sources.jellyfin = true
|
this.sources.jellyfin = true
|
||||||
|
|
||||||
await this.refreshDownloads()
|
await this.refreshDownloads()
|
||||||
|
this.updateView()
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|
|
@ -5,14 +5,17 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<li v-for="(view, name) in displayedViews" :key="name" :title="view.displayName"
|
<li v-for="(view, name) in displayedViews" :key="name" :title="view.displayName"
|
||||||
:class="{selected: name === selectedView, ...customClasses[name]}" @click="$emit('input', name)">
|
:class="{selected: name === selectedView, ...customClasses[name]}" @click="input(name)">
|
||||||
<i :class="view.iconClass" />
|
<i :class="view.iconClass" />
|
||||||
</li>
|
</li>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Utils from '@/Utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [Utils],
|
||||||
emits: ['input', 'toggle'],
|
emits: ['input', 'toggle'],
|
||||||
props: {
|
props: {
|
||||||
selectedView: {
|
selectedView: {
|
||||||
|
@ -78,6 +81,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
input(view) {
|
||||||
|
this.$emit('input', view)
|
||||||
|
this.setUrlArgs({view: view})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue