diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-19 17:19:24 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-19 17:28:36 +0200 |
commit | 5510bdae399c131f8911f4d4b39ec6832252c161 (patch) | |
tree | c9f1125f59572326b2d7eaffff38a60d8291fc18 /modules/luci-base | |
parent | 9c736c83924194979db88145780c018607f11cfb (diff) |
luci-base: render default values for all server side cbi map widgets
Fixes: 9c7eb1dec ("luci-base: switch from server side to client side widget markup")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/dropdown.htm | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/dynlist.htm | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/lvalue.htm | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/tvalue.htm | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/dropdown.htm b/modules/luci-base/luasrc/view/cbi/dropdown.htm index 40bd8e953..95bd0d4bd 100644 --- a/modules/luci-base/luasrc/view/cbi/dropdown.htm +++ b/modules/luci-base/luasrc/view/cbi/dropdown.htm @@ -1,6 +1,6 @@ <%+cbi/valueheader%> <div<%=attr("data-ui-widget", luci.util.serialize_json({ - "Dropdown", self:cfgvalue(section), self:choices(), { + "Dropdown", self:cfgvalue(section) or self.default, self:choices(), { id = cbid, name = cbid, sort = self.keylist, diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm index d50328d79..2a3da67ff 100644 --- a/modules/luci-base/luasrc/view/cbi/dynlist.htm +++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm @@ -1,6 +1,6 @@ <%+cbi/valueheader%> <div<%=attr("data-ui-widget", luci.util.serialize_json({ - "DynamicList", self:cfgvalue(section), self:choices(), { + "DynamicList", self:cfgvalue(section) or self.default, self:choices(), { name = cbid, size = self.size, sort = self.keylist, diff --git a/modules/luci-base/luasrc/view/cbi/lvalue.htm b/modules/luci-base/luasrc/view/cbi/lvalue.htm index e07648835..920b5e9f9 100644 --- a/modules/luci-base/luasrc/view/cbi/lvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/lvalue.htm @@ -1,6 +1,6 @@ <%+cbi/valueheader%> <div<%=attr("data-ui-widget", luci.util.serialize_json({ - "Select", self:cfgvalue(section), self:choices(), { + "Select", self:cfgvalue(section) or self.default, self:choices(), { id = cbid, name = cbid, size = self.size, diff --git a/modules/luci-base/luasrc/view/cbi/tvalue.htm b/modules/luci-base/luasrc/view/cbi/tvalue.htm index d1e9e6672..f3b12bd09 100644 --- a/modules/luci-base/luasrc/view/cbi/tvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/tvalue.htm @@ -1,5 +1,5 @@ <%+cbi/valueheader%> <textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> data-update="change"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") .. ifattr(self.readonly, "readonly") %>> - <%-=pcdata(self:cfgvalue(section))-%> + <%-=pcdata(self:cfgvalue(section) or self.default)-%> </textarea> <%+cbi/valuefooter%> |