summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-07-31 07:55:15 +0200
committerJo-Philipp Wich <jo@mein.io>2019-08-01 16:47:19 +0200
commit27e414646149876f71865622f0d5d5118231d0f7 (patch)
treee24374fa1514a9431cc3d0065b8d9e9f16bccc78 /modules/luci-base/htdocs
parent360e9769d612d4aab388cae2ddb74794eb08240f (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.js8
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;
}
}),