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:
parent
7bab8762f2
commit
6b1003cd50
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue