diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-20 22:43:29 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-20 22:43:29 +0000 |
commit | 5e45e4107b6f944942cfc31a4f408395a3361835 (patch) | |
tree | fc37afa48a5e5d8dde8f92d55cc37da11111ec60 /libs/web/htdocs/luci-static | |
parent | 7a7120a4479bc14b7951a3d4d6915b71edfe9015 (diff) |
libs/web: fix tab highlighting with multiple tabs
Diffstat (limited to 'libs/web/htdocs/luci-static')
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index a00254c76..7c5dd4ef4 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -437,6 +437,8 @@ function cbi_t_switch(section, tab) { } function cbi_t_update() { + var hl_tabs = [ ]; + for( var sid in cbi_t ) for( var tid in cbi_t[sid] ) if( cbi_c[cbi_t[sid][tid].cid] == 0 ) { @@ -446,9 +448,15 @@ function cbi_t_update() { cbi_t[sid][tid].tab.style.display = ''; var t = cbi_t[sid][tid].tab; - window.setTimeout(function() { t.className = t.className.replace(/ cbi-tab-highlighted/g, '') }, 750); - cbi_t[sid][tid].tab.className += ' cbi-tab-highlighted'; + t.className += ' cbi-tab-highlighted'; + hl_tabs.push(t); } + + if( hl_tabs.length > 0 ) + window.setTimeout(function() { + for( var i = 0; i < hl_tabs.length; i++ ) + hl_tabs[i].className = hl_tabs[i].className.replace(/ cbi-tab-highlighted/g, ''); + }, 750); } |