|
2 | 2 | $('.toctree-l1 > a:contains("Releases")').siblings().remove(); |
3 | 3 |
|
4 | 4 | //Check URL |
5 | | -var path = window.location.href; |
6 | | -var pathName = path.split('/'); |
7 | | -var num = pathName.length - 3; |
| 5 | +var path = window.location.pathname.split('/'); |
| 6 | +var cleanedPath = $.grep(path,function(n){ return(n) }); |
8 | 7 |
|
9 | | -switch(pathName[num]) { |
10 | | - case 'gettingstarted': |
11 | | - $('.toctree-l1 > a:contains("Getting Started")').attr('state', 'open'); |
| 8 | +// the second to last path segment is the section |
| 9 | +switch(cleanedPath[cleanedPath.length-2]) { |
| 10 | + case 'understanding_deis': |
| 11 | + $('.toctree-l1 > a:contains("Understanding Deis")').attr('state', 'open'); |
12 | 12 | break; |
13 | | - case 'installation': |
14 | | - $('.toctree-l1 > a:contains("Installation")').attr('state', 'open'); |
| 13 | + case 'installing_deis': |
| 14 | + $('.toctree-l1 > a:contains("Installing Deis")').attr('state', 'open'); |
15 | 15 | break; |
16 | | - case 'operations': |
17 | | - $('.toctree-l1 > a:contains("Operations")').attr('state', 'open'); |
| 16 | + case 'using_deis': |
| 17 | + $('.toctree-l1 > a:contains("Using Deis")').attr('state', 'open'); |
18 | 18 | break; |
19 | | - case 'developer': |
20 | | - $('.toctree-l1 > a:contains("Developer")').attr('state', 'open'); |
21 | | - break; |
22 | | - case 'components': |
23 | | - $('.toctree-l1 > a:contains("Components")').attr('state', 'open'); |
24 | | - break; |
25 | | - case 'topologies': |
26 | | - $('.toctree-l1 > a:contains("Topologies")').attr('state', 'open'); |
| 19 | + case 'managing_deis': |
| 20 | + $('.toctree-l1 > a:contains("Managing Deis")').attr('state', 'open'); |
27 | 21 | break; |
28 | 22 | case 'contributing': |
29 | 23 | $('.toctree-l1 > a:contains("Contributing")').attr('state', 'open'); |
30 | 24 | break; |
| 25 | + case 'reference': |
31 | 26 | case 'client': |
32 | | - $('.toctree-l1 > a:contains("Client Reference")').attr('state', 'open'); |
33 | | - break; |
34 | 27 | case 'server': |
35 | | - $('.toctree-l1 > a:contains("Server Reference")').attr('state', 'open'); |
| 28 | + case 'terms': |
| 29 | + $('.toctree-l1 > a:contains("Reference Guide")').attr('state', 'open'); |
36 | 30 | break; |
37 | 31 | default: |
38 | 32 | $('.toctree-l1 > a:contains("Version")').attr('state', 'close'); |
|
0 commit comments