koel/resources/assets/js/components/playlist/CreatePlaylistContextMenuButton.vue

25 lines
705 B
Vue
Raw Normal View History

2024-04-04 22:20:42 +00:00
<template>
<button
class="relative before:absolute before:w-[28px] before:aspect-square before:top-[-6px] before:left-[-6px] before:cursor-pointer"
title="Create a new playlist or folder"
type="button"
@click.stop.prevent="requestContextMenu"
>
<Icon :icon="faCirclePlus" />
</button>
</template>
2024-04-23 21:01:27 +00:00
<script lang="ts" setup>
2024-04-04 22:20:42 +00:00
import { faCirclePlus } from '@fortawesome/free-solid-svg-icons'
import { eventBus } from '@/utils'
const requestContextMenu = (e: MouseEvent) => {
const { bottom, right } = (e.currentTarget as HTMLButtonElement).getBoundingClientRect()
eventBus.emit('CREATE_NEW_PLAYLIST_CONTEXT_MENU_REQUESTED', {
top: bottom,
left: right,
2024-04-04 22:20:42 +00:00
})
}
</script>