]>
Commit | Line | Data |
---|---|---|
1 | (function(){ | |
2 | 'use strict'; | |
3 | ||
4 | var NAVS = { | |
5 | 'home': /^\/$/, | |
6 | 'pb': /^\/(?:pb|sol)\//, | |
7 | 'ct': /^\/(?:ct|st|ed)\//, | |
8 | 'log': /^\/log\//, | |
9 | 'us': /^\/us\//, | |
10 | 'account': /^\/account$/, | |
11 | 'contribute': /^\/contribute$/, | |
12 | 'about': /^\/about$/, | |
13 | }; | |
14 | ||
15 | $( document ).ready(function(){ | |
16 | var path = location.pathname; | |
17 | for (var nav in NAVS) | |
18 | if(path.match(NAVS[nav])) { | |
19 | $('#nav-' + nav).addClass('active'); | |
20 | break; | |
21 | } | |
22 | }); | |
23 | })(); |