summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/index.js15
-rw-r--r--site/templates/layout.html2
2 files changed, 14 insertions, 3 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()
diff --git a/site/templates/layout.html b/site/templates/layout.html
index 548bd7b3..ccf9262c 100644
--- a/site/templates/layout.html
+++ b/site/templates/layout.html
@@ -49,7 +49,7 @@
<div class='links'>
<a href="/datasets/">Datasets</a>
<a href="/about/">About</a>
- <a href="/about/updates">Updates</a>
+ <a href="/about/updates/">Updates</a>
</div>
</header>
<div class="content content-{{ metadata.cssclass }}">