From 1c494d3fd5fb746d5a5b6d582119cda261e1e7b5 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 14 Sep 2023 03:18:52 +0200 Subject: Update submodules --- src/html/chadombuilder.nim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/html/chadombuilder.nim') diff --git a/src/html/chadombuilder.nim b/src/html/chadombuilder.nim index 5ccc7ee2..23273747 100644 --- a/src/html/chadombuilder.nim +++ b/src/html/chadombuilder.nim @@ -120,7 +120,14 @@ proc insertText(builder: DOMBuilder[Node], parent: Node, text: string, discard parent.insertBefore(text, before) proc remove(builder: DOMBuilder[Node], child: Node) = - child.remove(true) + child.remove(suppressObservers = true) + +proc moveChildren(builder: DOMBuilder[Node], fromNode, toNode: Node) = + var tomove = fromNode.childList + for node in tomove: + node.remove(suppressObservers = true) + for child in tomove: + toNode.insert(child, nil) proc addAttrsIfMissing(builder: DOMBuilder[Node], element: Node, attrs: Table[string, string]) = @@ -183,6 +190,7 @@ proc newChaDOMBuilder(url: URL, window: Window): ChaDOMBuilder = insertBefore: insertBefore, insertText: insertText, remove: remove, + moveChildren: moveChildren, addAttrsIfMissing: addAttrsIfMissing, setScriptAlreadyStarted: setScriptAlreadyStarted, associateWithForm: associateWithForm, -- cgit 1.4.1-2-gfad0