diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-10-07 16:01:10 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-10-07 16:01:10 +0000 |
commit | c6143b89d3fe85cdb44fb579ad0e543749206db1 (patch) | |
tree | 94a7f8ed123930831eb563f81199a028aad106f2 /libs | |
parent | 9cacdbc05cf66bb452598b29d3ac57ea69cbadca (diff) |
* luci/libs/cbi: also set css class names for dynamically generated select lists
Diffstat (limited to 'libs')
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 2c7f99f06..d7bc74bc5 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -19,7 +19,7 @@ function cbi_d_add(field, dep, next) { "deps": [] }; cbi_d.unshift(entry); - } + } entry.deps.push(dep) } } @@ -27,17 +27,17 @@ function cbi_d_add(field, dep, next) { function cbi_d_checkvalue(target, ref) { var t = document.getElementById(target); var value; - + if (!t || !t.value) { value = ""; } else { value = t.value; - + if (t.type == "checkbox") { value = t.checked ? value : ""; } } - + return (value == ref) } @@ -50,7 +50,7 @@ function cbi_d_check(deps) { if (istat) { return true } - } + } } function cbi_d_update() { @@ -69,7 +69,7 @@ function cbi_d_update() { parent.appendChild(entry.node); } else { next.parentNode.insertBefore(entry.node, next); - } + } state = (state || (node && node.parentNode)) } } @@ -100,16 +100,17 @@ function cbi_bind(obj, type, callback, mode) { } function cbi_combobox(id, values, def, man) { - var selid = "cbi.combobox." + id + var selid = "cbi.combobox." + id; if (document.getElementById(selid)) { return } var obj = document.getElementById(id) var sel = document.createElement("select"); - sel.id = selid + sel.id = selid; + sel.className = 'cbi-input-select'; if (obj.nextSibling) { - obj.parentNode.insertBefore(sel, obj.nextSibling); + obj.parentNode.insertBefore(sel, obj.nextSibling); } else { obj.parentNode.appendChild(sel); } @@ -165,4 +166,4 @@ function cbi_combobox_init(id, values, def, man) { cbi_combobox(id, values, def, man) }); cbi_combobox(id, values, def, man); -}
\ No newline at end of file +} |