More UI optimizations
authorSteven Barth <steven@midlink.org>
Wed, 13 Aug 2008 18:01:30 +0000 (18:01 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 13 Aug 2008 18:01:30 +0000 (18:01 +0000)
libs/cbi/htdocs/luci-static/resources/cbi.js
libs/cbi/luasrc/view/cbi/tblsection.htm
themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css

index 18ef42068bf23fa74ea91d08a4b7ff5e81e19e9b..e42193cffcd407dea2fc3654480e1b9ed66f892c 100644 (file)
@@ -98,12 +98,12 @@ function cbi_combobox(id, values, def, man) {
        obj.style.display = "none";
 
        cbi_bind(sel, "change", function() {
-               obj.value = sel.options[sel.selectedIndex].value;
-
                if (sel.selectedIndex == sel.options.length - 1) {
                        obj.style.display = "inline";
                        sel.parentNode.removeChild(sel);
                        obj.focus();
+               } else {
+                       obj.value = sel.options[sel.selectedIndex].value;
                }
        })
 }
index cfee09f1c9f6d57d47776bf9edb399a17d9b753c..9d616255f3e09a9c33b6de1f7a863f423425ab5f 100644 (file)
@@ -31,9 +31,9 @@ end
                        <%- if not self.anonymous then -%>
                                <th>&nbsp;</th>
                        <%- end -%>
-                       <%- for i, k in pairs(self.children) do -%>
+                       <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell"><%=k.title%></th>
-                       <%- count = count + 1; end; if self.extedit or self.addremove then -%>
+                       <%- count = count + 1; end; end; if self.extedit or self.addremove then -%>
                                <th class="cbi-section-table-cell">&nbsp;</th>
                        <%- count = count + 1; end -%>
                        </tr>
@@ -41,9 +41,9 @@ end
                        <%- if not self.anonymous then -%>
                                <th>&nbsp;</th>
                        <%- end -%>
-                       <%- for i, k in pairs(self.children) do -%>
+                       <%- for i, k in pairs(self.children) do if not k.optional then -%>
                                <th class="cbi-section-table-cell"><%=k.description%></th>
-                       <%- end; if self.extedit or self.addremove then -%>
+                       <%- end; end; if self.extedit or self.addremove then -%>
                                <th class="cbi-section-table-cell">&nbsp;</th>
                        <%- end -%>
                        </tr>
@@ -57,7 +57,16 @@ end
                                <% if not self.anonymous then -%>
                                        <th><h3><%=k%></h3></th>
                                <%- end %>
-                               <%-+cbi/ucisection-%>
+
+
+                               <%-
+                                       for k, node in ipairs(self.children) do
+                                               if not node.optional then
+                                                       node:render(section, scope or {})
+                                               end
+                                       end
+                               -%>
+
                                <%- if self.extedit or self.addremove then -%>
                                        <td class="cbi-section-table-cell">
                                                <%- if self.extedit then -%>
index 78cb9542a390bb7404eaceee255fc7e886da6326..a1eaeaa8b9cd19c436b7118acf5b838f2fc85249 100644 (file)
@@ -337,7 +337,8 @@ table.smalltext tr td {
 
 div.cbi-value {
        clear: left;
-       padding: 0.25em;
+       vertical-align: middle;
+       padding-left: 0.25em;
        border-bottom: 1px dotted #bbbbbb;
 }