fix popup menu
This commit is contained in:
parent
e57a9a075c
commit
cfb46f2775
|
@ -54,8 +54,6 @@ const emits = defineEmits([
|
||||||
"changeName",
|
"changeName",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let menu = ref<Promise<any> | null>(null);
|
|
||||||
|
|
||||||
const _files = computed({
|
const _files = computed({
|
||||||
get: () => props.files,
|
get: () => props.files,
|
||||||
set: (value) => emits("updated", value),
|
set: (value) => emits("updated", value),
|
||||||
|
@ -121,9 +119,7 @@ async function describe(file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFileMenu(file, ev: MouseEvent) {
|
function showFileMenu(file, ev: MouseEvent) {
|
||||||
if (menu) return;
|
os.popupMenu(
|
||||||
menu = os
|
|
||||||
.popupMenu(
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: i18n.ts.renameFile,
|
text: i18n.ts.renameFile,
|
||||||
|
@ -158,9 +154,10 @@ function showFileMenu(file, ev: MouseEvent) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
ev.currentTarget ?? ev.target,
|
(ev.currentTarget ?? ev.target ?? undefined) as
|
||||||
)
|
| HTMLElement
|
||||||
.then(() => (menu = null));
|
| undefined,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue