mirror of
https://github.com/koel/koel
synced 2024-12-19 17:13:09 +00:00
24 lines
705 B
Vue
24 lines
705 B
Vue
<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>
|
|
|
|
<script lang="ts" setup>
|
|
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,
|
|
})
|
|
}
|
|
</script>
|