From 9a732f30dd30b601626ff9fa0b58cbb14a0edd10 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 19 Aug 2018 12:23:35 +0200 Subject: [PATCH] gluon-web-model: reorder Node arguments so Section:option() can just pass them through --- .../usr/lib/lua/gluon/web/model/classes.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 f03996b1..927b3f05 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 @@ -43,7 +43,7 @@ end Node = class() -function Node:__init__(title, description, name) +function Node:__init__(name, title, description) self.children = {} self.title = title or "" self.description = description or "" @@ -117,8 +117,8 @@ end Form = class(Node) -function Form:__init__(...) - Node.__init__(self, ...) +function Form:__init__(title, description, name) + Node.__init__(self, name, title, description) self.template = "model/form" end @@ -169,15 +169,15 @@ end Section = class(Node) -function Section:__init__(...) - Node.__init__(self, ...) +function Section:__init__(title, description, name) + Node.__init__(self, name, title, description) self.template = "model/section" end -function Section:option(t, option, title, description, ...) +function Section:option(t, ...) assert(instanceof(t, AbstractValue), "class must be a descendant of AbstractValue") - local obj = t(title, description, option, ...) + local obj = t(...) self:append(obj) return obj end @@ -185,8 +185,8 @@ end AbstractValue = class(Node) -function AbstractValue:__init__(option, ...) - Node.__init__(self, option, ...) +function AbstractValue:__init__(...) + Node.__init__(self, ...) self.deps = {} self.default = nil