summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-06-05 14:45:29 +0200
committerJules Laplace <julescarbon@gmail.com>2019-06-05 14:45:29 +0200
commitb2bc42ac8a62ba89837d46b9c4b97c98956bcf74 (patch)
tree86151913ed246a0abdbde1bfc20743943880ff7f /client
parentee3a403382d5373bc7cf6f4927c0df504985f4b8 (diff)
updates
Diffstat (limited to 'client')
-rw-r--r--client/index.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js
index 1a80e74f..59fb5176 100644
--- a/client/index.js
+++ b/client/index.js
@@ -143,10 +143,21 @@ function main() {
// if (paras.length) {
// paras[0].classList.add('first_paragraph')
// }
- toArray(document.querySelectorAll('header .links a')).forEach(tag => {
- if (window.location.href.match(tag.href)) {
+ let active = ''
+ const { href } = window.location
+ if (href.match('about/updates')) {
+ active = 'updates'
+ } else if (href.match('about')) {
+ active = 'about'
+ } else {
+ active = 'datasets'
+ }
+ toArray(document.querySelectorAll('header .links a')).some(tag => {
+ if (tag.href.match(active)) {
tag.classList.add('active')
+ return true
}
+ return false
})
runApplets()
buildWaypoints()