summaryrefslogtreecommitdiff
path: root/static/js/blog.js
blob: a49a72f4d2cb2da376c0af993d853bf6ff4f0094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';

/* globals window */

((window) => {

  const internals = {
    kEntryPoint: '.event-details',

    // Application entry point, for now just band to keyboard

    main() {

      window.document.addEventListener('keydown', internals._onKeyDown);
    },

    // Handles key events to point to the correct blog post.

    _onKeyDown(event) {

      if (['1','2','3'].indexOf(event.key) > -1) {
        window.location.hash = event.key;
      }
    }
  };

  window.addEventListener('load', internals.main);
})(window);