summaryrefslogtreecommitdiff
path: root/luci2/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-02-01 17:59:06 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-02-01 17:59:06 +0000
commit8f18cd5ef6869ab434fbe0fb002cb97fd34d3543 (patch)
treee4dc2a2a8d37252652105d3004e13a81f66db7b3 /luci2/htdocs
parent9946be73b1d6e674c232f16e3acb2d0486aee7ac (diff)
downloadluci2-ui-8f18cd5ef6869ab434fbe0fb002cb97fd34d3543.tar.gz
luci2: Introduce 'add' option to LuCI2.cbi.AbstractValue.depends() to support incrementally adding dependencies
Diffstat (limited to 'luci2/htdocs')
-rw-r--r--luci2/htdocs/luci2/luci2.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js
index 6e66128..00365ae 100644
--- a/luci2/htdocs/luci2/luci2.js
+++ b/luci2/htdocs/luci2/luci2.js
@@ -5240,7 +5240,7 @@ function LuCI2()
return (i.disabled || i.error.text() == '');
},
- depends: function(d, v)
+ depends: function(d, v, add)
{
var dep;
@@ -5285,7 +5285,11 @@ function LuCI2()
if ($.isEmptyObject(dep))
return this;
- this.dependencies.push(dep);
+ if (!add || !this.dependencies.length)
+ this.dependencies.push(dep);
+ else
+ for (var i = 0; i < this.dependencies.length; i++)
+ $.extend(this.dependencies[i], dep);
return this;
},