summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-compat
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-16 18:23:43 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-16 18:25:52 +0100
commit13e9e3e9e8633c7a54fe5fec1481e9df62594982 (patch)
tree3e57a63b3645c289c1b495d7587cf7f020a2090d /modules/luci-compat
parenteaa193336fc7b1f4bf2b8a51c120308d90e86e95 (diff)
treewide: fix "Unhandled token" errors with Lua CBI maps
The `data-type` attribute is used to bind datatype validators to a widget while some templates used the same attribute to denote the name of the underlying widget. Change the `data-type` attributes referring to the widget name to `data-widget` in order to stop the JS token error spam. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-compat')
-rw-r--r--modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm2
-rw-r--r--modules/luci-compat/luasrc/view/cbi/tblsection.htm4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
index 4b70957543..db5c66850d 100644
--- a/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
+++ b/modules/luci-compat/luasrc/view/cbi/cell_valueheader.htm
@@ -5,7 +5,7 @@
-%>
<div class="td cbi-value-field<% if self.error and self.error[section] then %> cbi-value-error<% end %><% if self.password then %> nowrap<% end %>"<%=
attr("data-name", self.option) ..
- ifattr(ftype and #ftype > 0, "data-type", ftype) ..
+ ifattr(ftype and #ftype > 0, "data-widget", ftype) ..
ifattr(title and #title > 0, "data-title", title, true) ..
ifattr(descr and #descr > 0, "data-description", descr, true)
%>>
diff --git a/modules/luci-compat/luasrc/view/cbi/tblsection.htm b/modules/luci-compat/luasrc/view/cbi/tblsection.htm
index 11c2206d8c..1e067edf38 100644
--- a/modules/luci-compat/luasrc/view/cbi/tblsection.htm
+++ b/modules/luci-compat/luasrc/view/cbi/tblsection.htm
@@ -52,7 +52,7 @@ function render_titles()
for i, k in ipairs(self.children) do
if not k.optional then
%><div class="th cbi-section-table-cell"<%=
- width(k) .. attr('data-type', k.typename) %>><%
+ width(k) .. attr('data-widget', k.typename) %>><%
if k.titleref then
%><a title="<%=self.titledesc or translate('Go to relevant configuration page')%>" class="cbi-title-ref" href="<%=k.titleref%>"><%
@@ -88,7 +88,7 @@ function render_descriptions()
for i, k in ipairs(self.children) do
if not k.optional then
%><div class="th cbi-section-table-cell"<%=
- width(k) .. attr("data-type", k.typename) %>><%
+ width(k) .. attr("data-widget", k.typename) %>><%
write(k.description)