diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-08-20 13:31:07 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-10 15:28:16 +0200 |
commit | 6b1003cd503d41fd8d533c353fb7a6298bdcc71f (patch) | |
tree | 0a1f264d1f55033c96333ceb9d8f4b3dc97569cc /modules/luci-base | |
parent | 7bab8762f244dd90ce02d7d19c666abab36c7afb (diff) |
luci-base: luci.js: support custom filter function in dom.isEmpty()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/luci.js | 4 |
1 files 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; |