luci-base: form.js: toggle inactive CSS class on unsatisfied field cells
authorJo-Philipp Wich <jo@mein.io>
Tue, 28 Apr 2020 07:51:54 +0000 (09:51 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 28 Apr 2020 07:51:54 +0000 (09:51 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js

index f9a9c5df79864a1aa178b0726a9ed5701cc50928..8525937f0b8c6a957e4c69643cbde1cec6fadf7a 100644 (file)
@@ -1777,6 +1777,10 @@ var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa
 
                if (field && field.classList.contains('hidden') == active) {
                        field.classList[active ? 'remove' : 'add']('hidden');
+
+                       if (dom.matches(field.parentNode, '.td.cbi-value-field'))
+                               field.parentNode.classList[active ? 'remove' : 'add']('inactive');
+
                        return true;
                }