summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2016-01-18 19:34:02 +0100
committerJo-Philipp Wich <jow@openwrt.org>2016-01-18 19:34:02 +0100
commit5eaf4cc489c0e8cd1ffdfde4355866cb5a481d96 (patch)
tree20390f6213de6b9f5340cd97e760db93298f1d0f /modules/luci-base/htdocs/luci-static
parent808c1b77f9008bc9f4a760ea0629b3fd4e49fbcb (diff)
luci-base: cbi: refactor event handling js
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 8bf94a6c5..fcf87adcb 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js
@@ -515,6 +515,15 @@ function cbi_init() {
}
}
+ nodes = document.querySelectorAll('[data-change]');
+
+ for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
+ var events = node.getAttribute('data-change').split(' ');
+ for (var j = 0, event; (event = events[j]) !== undefined; j++) {
+ cbi_bind(node, event, cbi_d_update);
+ }
+ }
+
cbi_d_update();
}