From: Jo-Philipp Wich Date: Tue, 19 Jan 2016 09:36:42 +0000 (+0100) Subject: luci-base: cbi: optimize tab hide logic X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7b7783f0eebce19c365835fdc192b50bd6efb6b9;p=oweals%2Fluci.git luci-base: cbi: optimize tab hide logic Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 3e71f17a6..227461070 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -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') {