From 312eb5180a5a8aee4e0ca79fc311c964d397a504 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 2 Oct 2017 13:52:49 +0200 Subject: [PATCH] added getVNodeById() for easier form handling --- src/karax.nim | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/karax.nim b/src/karax.nim index 737f3ef..a1597a3 100644 --- a/src/karax.nim +++ b/src/karax.nim @@ -38,6 +38,7 @@ type runCount: int components: seq[ComponentPair] surpressRedraws*: bool + byId: JDict[cstring, VNode] when defined(stats): recursion: int @@ -112,12 +113,19 @@ template detach(n: VNode) = template attach(n: VNode) = n.dom = result + if n.id != nil: kxi.byId[n.id] = n proc applyEvents(n: VNode; kxi: KaraxInstance) = let dest = n.dom for i in 0..