projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work around an ugly Opera and Internet Explorer event handling bug.
[project/luci.git]
/
libs
/
cbi
/
htdocs
/
luci-static
/
resources
/
cbi.js
diff --git
a/libs/cbi/htdocs/luci-static/resources/cbi.js
b/libs/cbi/htdocs/luci-static/resources/cbi.js
index
f70818e
..
eb2420a
100644
(file)
--- a/
libs/cbi/htdocs/luci-static/resources/cbi.js
+++ b/
libs/cbi/htdocs/luci-static/resources/cbi.js
@@
-24,11
+24,13
@@
function cbi_d_add(field, dep, next) {
}
}
}
}
-function cbi_d_
value(target
) {
+function cbi_d_
checkvalue(target, ref
) {
var t = document.getElementById(target);
var value
var t = document.getElementById(target);
var value
- if (!t || !t.value) {
+ if (!t) {
+ return true
+ } else if (!t.value) {
value = "";
} else {
value = t.value;
value = "";
} else {
value = t.value;
@@
-38,14
+40,14
@@
function cbi_d_value(target) {
}
}
}
}
- return
value
+ return
(value == ref)
}
function cbi_d_check(deps) {
for (var i=0; i<deps.length; i++) {
var istat = true
for (var j in deps[i]) {
}
function cbi_d_check(deps) {
for (var i=0; i<deps.length; i++) {
var istat = true
for (var j in deps[i]) {
- istat = (istat && cbi_d_
value(j) == deps[i][j]
)
+ istat = (istat && cbi_d_
checkvalue(j, deps[i][j])
)
}
if (istat) {
return true
}
if (istat) {
return true
@@
-100,8
+102,14
@@
function cbi_bind(obj, type, callback, mode) {
}
function cbi_combobox(id, values, def, man) {
}
function cbi_combobox(id, values, def, man) {
+ var selid = "cbi.combobox." + id
+ if (document.getElementById(selid)) {
+ return
+ }
+
var obj = document.getElementById(id)
var sel = document.createElement("select");
var obj = document.getElementById(id)
var sel = document.createElement("select");
+ sel.id = selid
if (obj.nextSibling) {
obj.parentNode.insertBefore(sel, obj.nextSibling);
} else {
if (obj.nextSibling) {
obj.parentNode.insertBefore(sel, obj.nextSibling);
} else {