diff options
author | Steven Barth <steven@midlink.org> | 2008-08-13 16:18:39 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-13 16:18:39 +0000 |
commit | 36f1dac36f14cbc53ece4d208d366e3203fd4a8c (patch) | |
tree | 560aaa30333e42fc344bfbc6fb350730675a8b00 /libs/cbi/htdocs | |
parent | 40d6a3c57e75b48d008006f87bfb07caef94c343 (diff) |
User interface improvements part #2
Diffstat (limited to 'libs/cbi/htdocs')
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index 01653e6e5..18ef42068 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -63,17 +63,19 @@ function cbi_combobox(id, values, def, man) { var sel = document.createElement("select"); obj.parentNode.appendChild(sel); - if (obj.value == "") { - var optdef = document.createElement("option"); - optdef.value = ""; - optdef.appendChild(document.createTextNode(def)); - sel.appendChild(optdef); - } else if (!values[obj.value]) { - var opt = document.createElement("option"); - opt.value = obj.value; - opt.selected = "selected"; - opt.appendChild(document.createTextNode(obj.value)); - sel.appendChild(opt); + if (!values[obj.value]) { + if (obj.value == "") { + var optdef = document.createElement("option"); + optdef.value = ""; + optdef.appendChild(document.createTextNode(def)); + sel.appendChild(optdef); + } else { + var opt = document.createElement("option"); + opt.value = obj.value; + opt.selected = "selected"; + opt.appendChild(document.createTextNode(obj.value)); + sel.appendChild(opt); + } } for (var i in values) { @@ -107,9 +109,9 @@ function cbi_combobox(id, values, def, man) { } function cbi_combobox_init(id, values, def, man) { - var obj = document.getElementById(id) + var obj = document.getElementById(id); cbi_bind(obj, "blur", function() { cbi_combobox(id, values, def, man) - }) - cbi_combobox(id, values, def, man) + }); + cbi_combobox(id, values, def, man); }
\ No newline at end of file |