summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/htdocs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-11-22 20:32:56 +0000
committerSteven Barth <steven@midlink.org>2009-11-22 20:32:56 +0000
commit19758fae439cffad8adaf64f2e8f74ae452816ee (patch)
tree55339f37986fbc586131f2e8336e0ed0cc6262fa /libs/cbi/htdocs
parentbbfdc9ea830aa14bd3d3ee7a394ba19fe707c9aa (diff)
CBI:
Implement reverse dependencies Allow wiazrd steps without buttons
Diffstat (limited to 'libs/cbi/htdocs')
-rw-r--r--libs/cbi/htdocs/luci-static/resources/cbi.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js
index 004e12eaa4..7ba81189ee 100644
--- a/libs/cbi/htdocs/luci-static/resources/cbi.js
+++ b/libs/cbi/htdocs/luci-static/resources/cbi.js
@@ -59,15 +59,26 @@ function cbi_d_checkvalue(target, ref) {
}
function cbi_d_check(deps) {
+ var reverse;
+ var def = false;
for (var i=0; i<deps.length; i++) {
- var istat = true
+ var istat = true;
+ reverse = false;
for (var j in deps[i]) {
- istat = (istat && cbi_d_checkvalue(j, deps[i][j]))
+ if (j.slice(-8) == "!reverse") {
+ reverse = true;
+ } else if (j.slice(-8) == "!default") {
+ def = true;
+ istat = false;
+ } else {
+ istat = (istat && cbi_d_checkvalue(j, deps[i][j]))
+ }
}
if (istat) {
- return true
+ return !reverse;
}
}
+ return def;
}
function cbi_d_update() {