libs/cbi: fix dynamic tab hiding
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 10 Oct 2009 22:18:50 +0000 (22:18 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 10 Oct 2009 22:18:50 +0000 (22:18 +0000)
libs/cbi/htdocs/luci-static/resources/cbi.js
libs/cbi/luasrc/view/cbi/tabmenu.htm

index f708d0f7fa4197c97d6458540436ac1960450edd..004e12eaa413ce23b1681c04071c14e76624f260 100644 (file)
@@ -36,9 +36,6 @@ function cbi_d_add(field, dep, next) {
                                "deps": []
                        };
                        cbi_d.unshift(entry);
-
-                       if( entry.parent )
-                               cbi_c[entry.parent] = (cbi_c[entry.parent] || 0) + 1;
                }
                entry.deps.push(dep)
        }
index 5cd5c76aaf93c15ad67af4b83eb6b8ec6aaf9a35..7648fe011b402d941ae0e850ca954cbb1119e683 100644 (file)
@@ -16,6 +16,7 @@ $Id$
        <ul class="cbi-tabmenu">
        <%- self.selected_tab = luci.http.formvalue("tab." .. self.config .. "." .. section) %>
        <%- for _, tab in ipairs(self.tab_names) do if #self.tabs[tab].childs > 0 then %>
+               <script type="text/javascript">cbi_c['container.<%=self.config%>.<%=section%>.<%=tab%>'] = <%=#self.tabs[tab].childs%>;</script>
                <%- if not self.selected_tab then self.selected_tab = tab end %>
                <li id="tab.<%=self.config%>.<%=section%>.<%=tab%>" class="cbi-tab<%=(tab == self.selected_tab) and '' or '-disabled'%>">
                        <a onclick="this.blur(); return cbi_t_switch('<%=self.config%>.<%=section%>', '<%=tab%>')" href="<%=REQUEST_URI%>?tab.<%=self.config%>.<%=section%>=<%=tab%>"><%=self.tabs[tab].title%></a>