luci-base: cbi: optimize tab hide logic
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 19 Jan 2016 09:36:42 +0000 (10:36 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 19 Jan 2016 09:36:54 +0000 (10:36 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 3e71f17..2274610 100644 (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') {