update: note card onClickOutside for context menu

main
TZGyn 3 years ago
parent 49d4a4ec98
commit 5d68e24396

@ -11,12 +11,10 @@
<ElementButton @click.stop="toggleOptions()"> <ElementButton @click.stop="toggleOptions()">
<Icon name="fa6-solid:ellipsis-vertical" /> <Icon name="fa6-solid:ellipsis-vertical" />
</ElementButton> </ElementButton>
<div <div class="relative">
class="relative"
v-auto-animate>
<div <div
v-if="showOptions" ref="options"
@click="toggleOptions()"> v-if="showOptions">
<div <div
class="bg-secondary border-lightgray absolute right-0 top-0 z-50 flex h-fit w-64 flex-col border"> class="bg-secondary border-lightgray absolute right-0 top-0 z-50 flex h-fit w-64 flex-col border">
<CardOptions <CardOptions
@ -47,6 +45,8 @@
const showDetail = ref<boolean>(false); const showDetail = ref<boolean>(false);
const showOptions = ref<boolean>(false); const showOptions = ref<boolean>(false);
const options = ref();
const toggleOptions = () => { const toggleOptions = () => {
showOptions.value = !showOptions.value; showOptions.value = !showOptions.value;
}; };
@ -58,4 +58,8 @@
const noteDetail = (id: string) => { const noteDetail = (id: string) => {
navigateTo(`/notes/${id}`); navigateTo(`/notes/${id}`);
}; };
onClickOutside(options, (event) => {
toggleOptions();
});
</script> </script>

Loading…
Cancel
Save