Unlink and delete notes
This commit is contained in:
parent
da74fa9261
commit
815e88cf18
2 changed files with 26 additions and 4 deletions
|
|
@ -12,6 +12,7 @@ import {
|
|||
RiCornerUpRightLine,
|
||||
RiDeleteBinLine,
|
||||
RiEditLine,
|
||||
RiLinkUnlinkM,
|
||||
RiPushpinFill,
|
||||
RiPushpinLine,
|
||||
} from "@remixicon/vue";
|
||||
|
|
@ -83,6 +84,15 @@ function onClick(): void {
|
|||
ui.toggleOpen(path);
|
||||
}
|
||||
|
||||
function onDeleteButtonClick(): void {
|
||||
notes.deleteNote(segment.id);
|
||||
}
|
||||
|
||||
function onUnlinkButtonClick(): void {
|
||||
if (parentId === undefined) return;
|
||||
notes.removeChild(parentId, segment);
|
||||
}
|
||||
|
||||
function onEditButtonClick(): void {
|
||||
if (!note.value) return;
|
||||
ui.edit(path);
|
||||
|
|
@ -208,9 +218,12 @@ function onInsertEditorCopy(): void {
|
|||
|
||||
<!-- Controls -->
|
||||
<div v-show="!editing" class="absolute right-0 flex h-6 items-center gap-0.5">
|
||||
<CNoteButton :visible="hovering">
|
||||
<CNoteButton :visible="hovering" @click.stop="onDeleteButtonClick">
|
||||
<RiDeleteBinLine size="16px" />
|
||||
</CNoteButton>
|
||||
<CNoteButton :visible="hovering" @click.stop="onUnlinkButtonClick">
|
||||
<RiLinkUnlinkM size="16px" />
|
||||
</CNoteButton>
|
||||
<CNoteButton :visible="hovering" @click.stop="onEditButtonClick">
|
||||
<RiEditLine size="16px" />
|
||||
</CNoteButton>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue