1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-22 11:17:40 +00:00

map convience functions (refactor)

This commit is contained in:
kepler155c@gmail.com
2019-02-25 09:02:40 -05:00
parent 687fc05445
commit 8f4324f1d8
3 changed files with 38 additions and 18 deletions

View File

@@ -122,10 +122,7 @@ function UI.Form:save()
end
for _,child in pairs(self.children) do
if child.formKey then
if (child.pruneEmpty and type(child.value) == 'string' and #child.value == 0) or
(child.pruneEmpty and type(child.value) == 'boolean' and not child.value) then
self.values[child.formKey] = nil
elseif child.validate == 'numeric' then
if child.validate == 'numeric' then
self.values[child.formKey] = tonumber(child.value)
else
self.values[child.formKey] = child.value