From 5fb9457c274ef96eff5302c1cbf37af203e1a566 Mon Sep 17 00:00:00 2001 From: Zdenko Vujasinovic Date: Sat, 18 Sep 2021 13:28:46 +0200 Subject: [PATCH] add support for a 'Fragment' tag --- source/jadelet.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/jadelet.coffee b/source/jadelet.coffee index 92ba00c..ed7a7a4 100644 --- a/source/jadelet.coffee +++ b/source/jadelet.coffee @@ -106,7 +106,7 @@ observeAttribute = (element, context, name, value) -> if isEvent("on#{name}", element) # It doesn't make sense for events to not be bound bindEvent(element, name, value.bind, context) - else + else bindObservable element, value, context, (newValue) -> if newValue? and newValue != false element.setAttribute name, newValue @@ -305,6 +305,8 @@ render = (astNode, context={}, namespace) -> if namespace element = document.createElementNS namespace, tag + else if tag is "Fragment" or tag is "<>" + element = document.createDocumentFragment() else element = document.createElement tag # We populate the content first so that value binding for `select` tags