X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fcbi%2Fhtdocs%2Fluci-static%2Fresources%2Fcbi.js;h=247228d225b47d6a3f15a88e3ecefae176153be7;hp=08ee593356eb3570cf02cc94a62753ff1b581cb5;hb=bddc2053b4d020a1982c8bfb86dde5a88dc47be6;hpb=565cc95f0db46e4d1e0bb947115af2d762c3b859 diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 08ee59335..247228d22 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -45,7 +45,18 @@ function cbi_d_checkvalue(target, ref) { var t = document.getElementById(target); var value; - if (!t || !t.value) { + if (!t) { + var tl = document.getElementsByName(target); + + if( tl.length > 0 && tl[0].type == 'radio' ) + for( var i = 0; i < tl.length; i++ ) + if( tl[i].checked ) { + value = tl[i].value; + break; + } + + value = value ? value : ""; + } else if (!t.value) { value = ""; } else { value = t.value; @@ -91,7 +102,7 @@ function cbi_d_update() { if (node && node.parentNode && !cbi_d_check(entry.deps)) { node.parentNode.removeChild(node); - state = (state || !node.parentNode); + state = true; if( entry.parent ) cbi_c[entry.parent]--; } else if ((!node || !node.parentNode) && cbi_d_check(entry.deps)) { @@ -100,7 +111,7 @@ function cbi_d_update() { } else { next.parentNode.insertBefore(entry.node, next); } - state = (state || (node && node.parentNode)) + state = true; if( entry.parent ) cbi_c[entry.parent]++; }