Skip to content
Snippets Groups Projects
Unverified Commit 9a732f30 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-web-model: reorder Node arguments so Section:option() can just pass them through

parent 653c1320
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment