diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-31 07:55:15 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-08-01 16:47:19 +0200 |
commit | 27e414646149876f71865622f0d5d5118231d0f7 (patch) | |
tree | e24374fa1514a9431cc3d0065b8d9e9f16bccc78 /modules/luci-base/htdocs | |
parent | 360e9769d612d4aab388cae2ddb74794eb08240f (diff) |
luci-base: luci.js: add L.dom.isEmpty() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/luci.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 259679f137..66f32d7223 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -1188,6 +1188,14 @@ return null; return inst[method].apply(inst, inst.varargs(arguments, 2)); + }, + + isEmpty: function(node) { + for (var child = node.firstElementChild; child != null; child = child.nextElementSibling) + if (!child.classList.contains('hidden')) + return false; + + return true; } }), |