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 StickyNote() {
|
||||||
function _handleClick(e: MouseEvent) {
|
function _handleClick(e: MouseEvent) {
|
||||||
|
|
||||||
NotesSigal.default.addNote({
|
NotesSigal.default.addNote({
|
||||||
type: "note",
|
type: "note",
|
||||||
title: "New Note",
|
title: "New Note",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { signal } from "kaioken"
|
import { signal } from "kaioken"
|
||||||
import { Card } from "../types"
|
import { Card } from "../types"
|
||||||
|
import { focusedItem } from "."
|
||||||
|
|
||||||
export type ImageCardType = Card<"image">
|
export type ImageCardType = Card<"image">
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ function addImage(data: Omit<ImageCardType, "id">) {
|
|||||||
}
|
}
|
||||||
images.value[newCard.id] = newCard
|
images.value[newCard.id] = newCard
|
||||||
images.notify()
|
images.notify()
|
||||||
|
focusedItem.value = newCard.id
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeImage(id: ImageCardType["id"]) {
|
function removeImage(id: ImageCardType["id"]) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { signal } from "kaioken"
|
import { signal } from "kaioken"
|
||||||
import { Card } from "../types"
|
import { Card } from "../types"
|
||||||
|
import { focusedItem } from "."
|
||||||
|
|
||||||
export type NoteCardType = Card<"note">
|
export type NoteCardType = Card<"note">
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ function addNote(data: Omit<NoteCardType, "id">) {
|
|||||||
}
|
}
|
||||||
notes.value[newCard.id] = newCard
|
notes.value[newCard.id] = newCard
|
||||||
notes.notify()
|
notes.notify()
|
||||||
|
focusedItem.value = newCard.id
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeNote(id: NoteCardType["id"]) {
|
function removeNote(id: NoteCardType["id"]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user