|
1 | 1 | //Remove <ul> from Releases |
2 | | -$('.toctree-l1 > a').each(function(){ |
3 | | - if($(this).html() == "Releases") { |
4 | | - $(this).parent().html('<a class="reference internal" href="/latest/releases/">Releases</a>'); |
5 | | - } |
6 | | -}); |
| 2 | +$('.toctree-l1 > a:contains("Releases")').siblings().remove(); |
7 | 3 |
|
8 | 4 | //Check URL |
9 | 5 | var path = window.location.href; |
10 | 6 | var pathName = path.split('/'); |
11 | 7 | var num = pathName.length - 3; |
12 | | -var gettingstarted, terms, client, server, contributing; |
13 | 8 |
|
14 | 9 | switch(pathName[num]) { |
15 | 10 | case 'gettingstarted': |
16 | | - //case at Getting Started |
17 | | - $('.toctree-l1 > a').each(function(){ |
18 | | - if($(this).html() == "Getting Started") { |
19 | | - $(this).attr('state', 'open'); |
20 | | - } |
21 | | - }); |
| 11 | + $('.toctree-l1 > a:contains("Getting Started")').attr('state', 'open'); |
22 | 12 | break; |
23 | 13 | case 'terms': |
24 | | - //case at Terms |
25 | | - $('.toctree-l1 > a').each(function(){ |
26 | | - if($(this).html() == "Terms") { |
27 | | - $(this).attr('state', 'open'); |
28 | | - } |
29 | | - }); |
| 14 | + $('.toctree-l1 > a:contains("Terms")').attr('state', 'open'); |
30 | 15 | break; |
31 | 16 | case 'client': |
32 | | - //case at Client Reference |
33 | | - $('.toctree-l1 > a').each(function(){ |
34 | | - if($(this).html() == "Client Reference") { |
35 | | - $(this).attr('state', 'open'); |
36 | | - } |
37 | | - }); |
| 17 | + $('.toctree-l1 > a:contains("Client Reference")').attr('state', 'open'); |
38 | 18 | break; |
39 | 19 | case 'server': |
40 | | - //case at Server Reference |
41 | | - $('.toctree-l1 > a').each(function(){ |
42 | | - if($(this).html() == "Server Reference") { |
43 | | - $(this).attr('state', 'open'); |
44 | | - } |
45 | | - }); |
| 20 | + $('.toctree-l1 > a:contains("Server Reference")').attr('state', 'open'); |
46 | 21 | break; |
47 | 22 | case 'contributing': |
48 | | - //case at Contributing |
49 | | - $('.toctree-l1 > a').each(function(){ |
50 | | - if($(this).html() == "Contributing") { |
51 | | - $(this).attr('state', 'open'); |
52 | | - } |
53 | | - }); |
| 23 | + $('.toctree-l1 > a:contains("Contributing")').attr('state', 'open'); |
54 | 24 | break; |
55 | 25 | case 'releases': |
56 | 26 | //code this out when releases gets filled out |
57 | 27 | break; |
58 | 28 | default: |
59 | 29 | } |
60 | | - |
0 commit comments