mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 09:57:29 -07:00
fix popup menu
This commit is contained in:
parent
9a6b38aa1a
commit
446fc9830c
1 changed files with 35 additions and 38 deletions
|
@ -54,8 +54,6 @@ const emits = defineEmits([
|
|||
"changeName",
|
||||
]);
|
||||
|
||||
let menu = ref<Promise<any> | null>(null);
|
||||
|
||||
const _files = computed({
|
||||
get: () => props.files,
|
||||
set: (value) => emits("updated", value),
|
||||
|
@ -121,9 +119,7 @@ async function describe(file) {
|
|||
}
|
||||
|
||||
function showFileMenu(file, ev: MouseEvent) {
|
||||
if (menu) return;
|
||||
menu = os
|
||||
.popupMenu(
|
||||
os.popupMenu(
|
||||
[
|
||||
{
|
||||
text: i18n.ts.renameFile,
|
||||
|
@ -158,9 +154,10 @@ function showFileMenu(file, ev: MouseEvent) {
|
|||
},
|
||||
},
|
||||
],
|
||||
ev.currentTarget ?? ev.target,
|
||||
)
|
||||
.then(() => (menu = null));
|
||||
(ev.currentTarget ?? ev.target ?? undefined) as
|
||||
| HTMLElement
|
||||
| undefined,
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue