luci-base: luci.js: add L.dom.isEmpty() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
360e9769d6
commit
27e4146461
1 changed files with 8 additions and 0 deletions
|
@ -1188,6 +1188,14 @@
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return inst[method].apply(inst, inst.varargs(arguments, 2));
|
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;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue