From 0bc06f8de0af1cf5256dc6434544497685dc3a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Sat, 28 May 2022 09:06:34 +0200 Subject: [PATCH] fixup! webmodel element kv --- .../luasrc/usr/lib/lua/gluon/web/model/classes.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua index 64b15b25..88f378c0 100644 --- a/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua +++ b/package/gluon-web-model/luasrc/usr/lib/lua/gluon/web/model/classes.lua @@ -413,7 +413,7 @@ end local Element = class(Node) M.Element = Element -function Element:__init__(template, ...) +function Element:__init__(template, kv, ...) Node.__init__(self, ...) self.default = nil @@ -422,6 +422,10 @@ function Element:__init__(template, ...) self.template = template + for key, value in pairs(kv) do + self[key] = value + end + self.error = false end