diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-05 18:23:32 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-05 18:23:32 +0100 |
| commit | 03ed12b471c1e50ae531c46fcbf5afd06ca5432b (patch) | |
| tree | 67f48d66b2e9def2e514359b150e5f1384d9a3d2 /site/assets/js | |
| parent | 2a1b884e841efe562e0c84885a404819433b3405 (diff) | |
build
Diffstat (limited to 'site/assets/js')
| -rw-r--r-- | site/assets/js/app/site.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/site/assets/js/app/site.js b/site/assets/js/app/site.js index 04c0c495..12bee3ec 100644 --- a/site/assets/js/app/site.js +++ b/site/assets/js/app/site.js @@ -7,6 +7,8 @@ const isDesktop = !isMobile const htmlClassList = document.body.parentNode.classList htmlClassList.add(isDesktop ? 'desktop' : 'mobile') +function toArray(A) { return Array.prototype.slice.apply(A) } + var site = (function(){ var site = {} site.init = function(){ @@ -17,6 +19,11 @@ var site = (function(){ if (paras.length) { paras[0].classList.add('first_paragraph') } + toArray(document.querySelectorAll('header .links a')).forEach(tag => { + if (window.location.href.match(tag.href)) { + tag.classList.add('active') + } + }) } site.init() })()
\ No newline at end of file |
