]> iEval git - plack-app-gruntmaster.git/blobdiff - js/90-nav.js
Make JS a bit simpler
[plack-app-gruntmaster.git] / js / 90-nav.js
index 92a9d4355de767670611d4139fdf6af01444aadb..36aec02c3b8c9b9229b6129778e78ba3fb9db93d 100644 (file)
@@ -1,21 +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\//,
-               'ct': /^\/(?:ct|st)\//,
-               'log': /^\/log\//,
-               'us': /^\/us\//,
-               'account': /^\/account$/,
-       };
-
-       $( 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]))
+                       q('#nav-' + nav).classList.add('active');
+});
This page took 0.018955 seconds and 4 git commands to generate.