mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-10 08:18:22 +00:00
minor cleanup
This commit is contained in:
@@ -46,15 +46,12 @@ function Widget:constructor (layout, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Widget:extract (data)
|
function Widget:extract (data)
|
||||||
function toWidget(t)
|
local children = self.children
|
||||||
if t.isWidget then return t end
|
-- TODO: get rid of pairs somehow
|
||||||
return Widget.create(self.layout, t)
|
|
||||||
end
|
|
||||||
|
|
||||||
for k, v in pairs(data) do
|
for k, v in pairs(data) do
|
||||||
if type(k) == 'number' then
|
if type(k) == 'number' then
|
||||||
self.children[k] = toWidget(v)
|
children[k] = v.isWidget and v or Widget.create(self.layout, v)
|
||||||
self.children[k].parent = self
|
children[k].parent = self
|
||||||
else
|
else
|
||||||
self[k] = v
|
self[k] = v
|
||||||
end
|
end
|
||||||
@@ -239,8 +236,6 @@ function Widget:update ()
|
|||||||
self.layout:update()
|
self.layout:update()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- event binders
|
|
||||||
|
|
||||||
Event.injectBinders(Widget)
|
Event.injectBinders(Widget)
|
||||||
|
|
||||||
return Widget
|
return Widget
|
||||||
|
|||||||
Reference in New Issue
Block a user