X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-nav.js;h=b4127d6390eb55977b1a5f4b7f0f2e5d060d31d9;hb=65d5cb3b6007fa0bc758722983b3f0afefc02f2e;hp=fc91ff1dfb364245c5d315378f5dfff57e07c3c8;hpb=f1ca277108d24951290bd4162d2a336bd02c44fd;p=plack-app-gruntmaster.git diff --git a/js/90-nav.js b/js/90-nav.js index fc91ff1..b4127d6 100644 --- a/js/90-nav.js +++ b/js/90-nav.js @@ -1,22 +1,16 @@ -(function(){ - 'use strict'; +const NAVS = { + home: /^\/$/, + pb: /^\/(?:pb|sol)\//, + ct: /^\/(?:ct|st|ed)\//, + log: /^\/log\//, + us: /^\/us\//, + account: /^\/account$/, + contribute: /^\/contribute$/, +}; - var NAVS = { - 'home': /^\/$/, - 'pb': /^\/(?:pb|sol)\//, - 'ct': /^\/(?:ct|st|ed)\//, - 'log': /^\/log\//, - 'us': /^\/us\//, - 'account': /^\/account$/, - 'contribute': /^\/contribute$/, - }; - - $( document ).ready(function(){ - var path = location.pathname; - for (var nav in NAVS) - if(path.match(NAVS[nav])) { - $('#nav-' + nav).addClass('active'); - break; - } - }); -})(); +$(function(){ + const path = location.pathname; + for (const nav in NAVS) + if(path.match(NAVS[nav])) + $('#nav-' + nav)[0].classList.add('active'); +});