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