mirror of
https://github.com/openwrt/luci.git
synced 2025-12-26 13:26:20 +04:00
luci-base: luci.js: support custom filter function in dom.isEmpty()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -1230,9 +1230,9 @@
|
||||
return inst[method].apply(inst, inst.varargs(arguments, 2));
|
||||
},
|
||||
|
||||
isEmpty: function(node) {
|
||||
isEmpty: function(node, ignoreFn) {
|
||||
for (var child = node.firstElementChild; child != null; child = child.nextElementSibling)
|
||||
if (!child.classList.contains('hidden'))
|
||||
if (!child.classList.contains('hidden') && (!ignoreFn || !ignoreFn(child)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user