From f56890a5733b3c57d088b52bf91a77c44976ca99 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 2 Jun 2008 17:49:27 +0000 Subject: * Added native basic authentication support * Cleanups --- libs/cbi/luasrc/cbi.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libs/cbi/luasrc/cbi.lua') diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 42b58ce0b4..178c46f03c 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -579,11 +579,6 @@ function AbstractValue.render(self, s, scope) if not self.optional or self:cfgvalue(s) or self:formcreated(s) then scope = scope or {} scope.section = s - - -- fixup size for MultiValue fields - if instanceof(self, MultiValue) and self.widget == "select" and not self.size then - self.size = #self.vallist - end Node.render(self, scope) end @@ -741,6 +736,14 @@ function MultiValue.__init__(self, ...) self.delimiter = " " end +function MultiValue.render(self, ...) + if self.widget == "select" and not self.size then + self.size = #self.vallist + end + + AbstractValue.render(self, ...) +end + function MultiValue.value(self, key, val) val = val or key table.insert(self.keylist, tostring(key)) -- cgit v1.2.3