From: Jo-Philipp Wich Date: Thu, 9 Aug 2012 23:42:53 +0000 (+0000) Subject: libs/web: rework unspecified/create logic for checkboxes in network_netlist widget X-Git-Tag: 0.11.0~400 X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=c78e445583bb49907f18888b2747db5fd84e0f97 libs/web: rework unspecified/create logic for checkboxes in network_netlist widget --- diff --git a/libs/web/luasrc/view/cbi/network_netlist.htm b/libs/web/luasrc/view/cbi/network_netlist.htm index 8568ced44..8013f2cc0 100644 --- a/libs/web/luasrc/view/cbi/network_netlist.htm +++ b/libs/web/luasrc/view/cbi/network_netlist.htm @@ -49,9 +49,14 @@ <% if not self.nocreate then %>
  • - " onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value, "checked", "checked")%> />   + " onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%=attr("type", self.widget or "radio") .. attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value and self.widget ~= "checkbox", "checked", "checked")%> />  
    - ><%:unspecified -or- create:%>  + > + <%- if self.widget == "checkbox" then -%> + <%:create:%> + <%- else -%> + <%:unspecified -or- create:%> + <%- end -%>  onfocus="document.getElementById('<%=cbid%>_new').checked=true" />