From 6b1003cd503d41fd8d533c353fb7a6298bdcc71f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 20 Aug 2019 13:31:07 +0200 Subject: [PATCH] luci-base: luci.js: support custom filter function in dom.isEmpty() Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/luci.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index d72764b114..582e373009 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -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; -- 2.30.2