luci-base: cbi: optimize tab hide logic

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2016-01-19 10:36:42 +01:00
parent 6f688a3265
commit 7b7783f0ee

View file

@ -947,9 +947,8 @@ function cbi_t_update() {
{
var t = cbi_t[sid][tid].tab;
var c = cbi_t[sid][tid].container;
var n = c.getElementsByTagName('div');
if (n.length === 0) {
if (!c.firstElementChild) {
t.style.display = 'none';
}
else if (t.style.display == 'none') {