mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
remove div nesting on right sidebar
+ rewrite vTooltip to handle updates to tooltip text
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
:tracks="disc"
|
||||
:on_album_page="true"
|
||||
:disc="key"
|
||||
:copyright="isLastDisc(key) ? () => copyright : null"
|
||||
:copyright="isLastDisc(key) ? copyright : null"
|
||||
@playFromPage="playFromAlbumPage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,6 +16,8 @@
|
||||
<script setup lang="ts">
|
||||
import { Track } from "@/interfaces";
|
||||
import SongList from "@/components/FolderView/SongList.vue";
|
||||
import useQueueStore from "@/stores/queue";
|
||||
import useAlbumStore from "@/stores/pages/album";
|
||||
|
||||
const props = defineProps<{
|
||||
discs: {
|
||||
@@ -23,11 +26,20 @@ const props = defineProps<{
|
||||
copyright?: string;
|
||||
}>();
|
||||
|
||||
const queue = useQueueStore();
|
||||
const album = useAlbumStore();
|
||||
|
||||
// check if the disc is the last disc
|
||||
const isLastDisc = (disc: string | number) => {
|
||||
const discs = Object.keys(props.discs);
|
||||
return discs[discs.length - 1] === disc;
|
||||
};
|
||||
|
||||
function playFromAlbumPage(index: number) {
|
||||
const { title, artist, hash } = album.info;
|
||||
queue.playFromAlbum(title, artist, hash, album.tracks);
|
||||
queue.play(index);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user