From: Jo-Philipp Wich Date: Mon, 2 Jun 2008 16:21:41 +0000 (+0000) Subject: * luci/core: cbi.lua: automatically set size of MultiValue fields X-Git-Tag: 0.8.0~915 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=92d76ed83603e50321f171996fc78cef0a6d3580;p=oweals%2Fluci.git * luci/core: cbi.lua: automatically set size of MultiValue fields --- diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index ace35d951..42b58ce0b 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -579,6 +579,12 @@ 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 end