From 565cc95f0db46e4d1e0bb947115af2d762c3b859 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 23 Nov 2009 13:09:52 +0000 Subject: [PATCH] CBI: Free dependencies --- libs/cbi/htdocs/luci-static/resources/cbi.js | 4 ++-- libs/cbi/luasrc/view/cbi/full_valuefooter.htm | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 7ba81189e..08ee59335 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -65,9 +65,9 @@ function cbi_d_check(deps) { var istat = true; reverse = false; for (var j in deps[i]) { - if (j.slice(-8) == "!reverse") { + if (j == "!reverse") { reverse = true; - } else if (j.slice(-8) == "!default") { + } else if (j == "!default") { def = true; istat = false; } else { diff --git a/libs/cbi/luasrc/view/cbi/full_valuefooter.htm b/libs/cbi/luasrc/view/cbi/full_valuefooter.htm index 9130a99f9..e1174e250 100644 --- a/libs/cbi/luasrc/view/cbi/full_valuefooter.htm +++ b/libs/cbi/luasrc/view/cbi/full_valuefooter.htm @@ -34,8 +34,16 @@ $Id$ cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", { <%- for k,v in pairs(d.deps) do + local depk + if k:find("!", 1, true) then + depk = string.format('"%s"', k) + elseif k:find(".", 1, true) then + depk = string.format('"cbid.%s"', k) + else + depk = string.format('"cbid.%s.%s.%s"', self.config, section, k) + end -%> - <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%> + <%-= depk .. ":" .. string.format("%q", v)-%> <%-if next(d.deps, k) then-%>,<%-end-%> <%- end -- 2.25.1