little fixes: returing new instance

This commit is contained in:
Insality 2019-03-28 10:19:58 +03:00
parent b317d390f6
commit 235476fee4

View File

@ -29,9 +29,9 @@ end
function M.register(name, module) function M.register(name, module)
-- TODO: Find better solution to creating elements? -- TODO: Find better solution to creating elements?
_factory["new_" .. name] = function(factory, node_or_name, ...) _factory["new_" .. name] = function(factory, node_or_name, ...)
_factory.new(factory, module, node_or_name, ...) return _factory.new(factory, module, node_or_name, ...)
end end
log("Register component", name) log("Register component", name)
end end
--- Create UI instance for ui elements --- Create UI instance for ui elements
@ -92,6 +92,8 @@ function _factory.new(factory, module, node_or_name, ...)
if instance.init then if instance.init then
instance:init(...) instance:init(...)
end end
return instance
end end