Merge branch 'master' into newmc
[gruntmaster-page.git] / js / 90-nav.js
index 7f96eeb320c2aa6f22f3a1d8d1c9810d79e29489..4412e3a89ff038d92b1ae9f916fd20639dbc9e5d 100644 (file)
@@ -1,23 +1,17 @@
-(function(){
-       'use strict';
+const NAVS = {
+       home: /^\/$/,
+       pb: /^\/(?:pb|sol)\//,
+       ct: /^\/(?:ct|st|ed)\//,
+       log: /^\/log\//,
+       us: /^\/us\//,
+       account: /^\/account$/,
+       contribute: /^\/contribute$/,
+       about: /^\/about$/,
+};
 
-       var NAVS = {
-               'home': /^\/$/,
-               'pb': /^\/(?:pb|sol)\//,
-               'ct': /^\/(?:ct|st|ed)\//,
-               'log': /^\/log\//,
-               'us': /^\/us\//,
-               'account': /^\/account$/,
-               'contribute': /^\/contribute$/,
-               'about': /^\/about$/,
-       };
-
-       $( document ).ready(function(){
-               var path = location.pathname;
-               for (var nav in NAVS)
-                       if(path.match(NAVS[nav])) {
-                               $('#nav-' + nav).addClass('active');
-                               break;
-                       }
-       });
-})();
+$(function(){
+       let path = location.pathname;
+       for (let nav in NAVS)
+               if(path.match(NAVS[nav]))
+                       $('#nav-' + nav)[0].classList.add('active');
+});
This page took 0.009504 seconds and 4 git commands to generate.