summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-22 08:42:58 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-22 08:42:58 +0100
commit4f0d67a2897d6592cb0f7562fa042dd4987fd7eb (patch)
tree74b52d3fa382e934444396e98ee0af4216c710c7 /modules/luci-base/htdocs
parent4fe16b1ec61ebed400d86d3618419e6c64bb38dd (diff)
luci-base: validation.js: fix "unique" validator
Previous refactoring renamed the "data-type" attribute of widget markup containers to "data-widget", breaking the "unique" validator as it relies on it to lookup options. Fixes: #3341 Fixes: 13e9e3e9e ("treewide: fix "Unhandled token" errors with Lua CBI maps") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/validation.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/validation.js b/modules/luci-base/htdocs/luci-static/resources/validation.js
index 79ae1d670..dbf30488c 100644
--- a/modules/luci-base/htdocs/luci-static/resources/validation.js
+++ b/modules/luci-base/htdocs/luci-static/resources/validation.js
@@ -535,9 +535,9 @@ var ValidatorFactory = L.Class.extend({
unique: function(subvalidator, subargs) {
var ctx = this,
- option = findParent(ctx.field, '[data-type][data-name]'),
+ option = findParent(ctx.field, '[data-widget][data-name]'),
section = findParent(option, '.cbi-section'),
- query = '[data-type="%s"][data-name="%s"]'.format(option.getAttribute('data-type'), option.getAttribute('data-name')),
+ query = '[data-widget="%s"][data-name="%s"]'.format(option.getAttribute('data-widget'), option.getAttribute('data-name')),
unique = true;
section.querySelectorAll(query).forEach(function(sibling) {