mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
bbe7984e4e
+ normalize context children too + add setting to toggle context children via click or hover + add a select setting component + remove dead teleport code from sidebar tabs wrapper + general clean up
29 lines
689 B
TypeScript
29 lines
689 B
TypeScript
import { Ref } from "vue";
|
|
|
|
import useModalStore from "@/stores/modal";
|
|
import useQueueStore from "@/stores/queue";
|
|
import useContextStore from "@/stores/context";
|
|
|
|
import { ContextSrc } from "./enums";
|
|
import { Track } from "@/interfaces";
|
|
import trackContext from "@/contexts/track_context";
|
|
|
|
export const showTrackContextMenu = (
|
|
e: MouseEvent,
|
|
track: Track,
|
|
flag: Ref<boolean>
|
|
) => {
|
|
const menu = useContextStore();
|
|
|
|
const options = () => trackContext(track, useModalStore, useQueueStore);
|
|
|
|
menu.showContextMenu(e, options, ContextSrc.Track);
|
|
flag.value = true;
|
|
|
|
menu.$subscribe((mutation, state) => {
|
|
if (!state.visible) {
|
|
flag.value = false;
|
|
}
|
|
});
|
|
};
|