]> git.r.bdr.sh - rbdr/blog/blame - static/js/blog.js
📝 Update CHANGELOG
[rbdr/blog] / static / js / blog.js
CommitLineData
39744467
BB
1'use strict';
2
3/* globals window */
4
5((window) => {
6
7 const internals = {
8 kEntryPoint: '.event-details',
9
10 // Application entry point, for now just band to keyboard
11
12 main() {
13
14 window.document.addEventListener('keydown', internals._onKeyDown);
15 },
16
17 // Handles key events to point to the correct blog post.
18
19 _onKeyDown(event) {
20
21 if (['1','2','3'].indexOf(event.key) > -1) {
22 window.location.hash = event.key;
23 }
24 }
25 };
26
27 window.addEventListener('load', internals.main);
28})(window);