generated from Klectr/KTemplate
focus newly added card
This commit is contained in:
parent
32cd89a4d1
commit
9016796b51
@ -19,7 +19,6 @@ export function CardSelector() {
|
||||
|
||||
function StickyNote() {
|
||||
function _handleClick(e: MouseEvent) {
|
||||
|
||||
NotesSigal.default.addNote({
|
||||
type: "note",
|
||||
title: "New Note",
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { signal } from "kaioken"
|
||||
import { Card } from "../types"
|
||||
import { focusedItem } from "."
|
||||
|
||||
export type ImageCardType = Card<"image">
|
||||
|
||||
@ -16,6 +17,7 @@ function addImage(data: Omit<ImageCardType, "id">) {
|
||||
}
|
||||
images.value[newCard.id] = newCard
|
||||
images.notify()
|
||||
focusedItem.value = newCard.id
|
||||
}
|
||||
|
||||
function removeImage(id: ImageCardType["id"]) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { signal } from "kaioken"
|
||||
import { Card } from "../types"
|
||||
import { focusedItem } from "."
|
||||
|
||||
export type NoteCardType = Card<"note">
|
||||
|
||||
@ -16,6 +17,7 @@ function addNote(data: Omit<NoteCardType, "id">) {
|
||||
}
|
||||
notes.value[newCard.id] = newCard
|
||||
notes.notify()
|
||||
focusedItem.value = newCard.id
|
||||
}
|
||||
|
||||
function removeNote(id: NoteCardType["id"]) {
|
||||
|
Loading…
Reference in New Issue
Block a user