Fix option dependencies, this was lost in some IE fixing stuff
[project/luci.git] / libs / cbi / luasrc / view / cbi / full_valuefooter.htm
index 8003f53..9fc5c13 100644 (file)
@@ -13,7 +13,7 @@ $Id$
 
 -%>
 
-               <% if #self.description > 0 then -%>
+               <% if self.description and #self.description > 0 then -%>
                        <% if not luci.util.instanceof( self, luci.cbi.Flag ) then -%>
                                <br />
                        <%- end %>
@@ -25,31 +25,21 @@ $Id$
        <%- if self.title and #self.title > 0 then -%>
        </div>
        <%- end -%>
-
-       <% if self.tag_error[section] then -%>
-               <div class="cbi-error"><%=self.tag_error[section]%></div>
-       <%- elseif self.tag_reqerror[section] then -%>
-               <div class="cbi-error"><%:cbi_reqerror%></div>
-       <%- elseif self.tag_invalid[section] then -%>
-               <div class="cbi-error"><%:cbi_invalid%></div>
-       <%- elseif self.tag_missing[section] then -%>
-               <div class="cbi-error"><%:cbi_missing%></div>
-       <%- end %>
-
 </div>
 
 <% if #self.deps > 0 then -%>
-       <script type="text/javascript">
+       <script type="text/javascript" id="cbip-<%=self.config.."-"..section.."-"..self.option%>">
                <% for j, d in ipairs(self.deps) do -%>
                        cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", {
                <%-
                        for k,v in pairs(d.deps) do
                -%>
-                       <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>,
+                       <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>
+                       <%-if next(d.deps, k) then-%>,<%-end-%>
                <%-
                        end
                -%>
-                       });
+                       }, "cbip-<%=self.config.."-"..section.."-"..self.option..d.add%>");
                <%- end %>
        </script>
 <%- end %>