diff --git a/src/features/boards/Board.vue b/src/features/boards/Board.vue index 2605aaa..7d50aa4 100644 --- a/src/features/boards/Board.vue +++ b/src/features/boards/Board.vue @@ -44,6 +44,7 @@ :selectedAction="unref(selectedAction)" @mouseDown="mouseDown" @endDragging="endDragging" + @clickAction="actionId => clickAction(node, actionId)" /> @@ -240,6 +241,15 @@ function endDragging(nodeID: number | null) { props.state.value.selectedAction = null; } } + +function clickAction(node: BoardNode, actionId: string) { + if (props.state.value.selectedAction === actionId) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + unref(props.selectedAction)!.onClick(unref(props.selectedNode)!); + } else { + props.state.value = { ...props.state.value, selectedAction: actionId }; + } +}