diff options
| author | Teddy Wing | 2019-05-01 17:54:22 +0200 |
|---|---|---|
| committer | Teddy Wing | 2019-05-01 17:54:22 +0200 |
| commit | 75221eab7a3188a92d221b2d0be7a9d082fca31a (patch) | |
| tree | 7a497214702634cc99e61f4e5bde7024ae0b06f0 | |
| parent | fc04446765471311ac8818fa8bc411b5ed384791 (diff) | |
| download | muttagen-75221eab7a3188a92d221b2d0be7a9d082fca31a.tar.bz2 | |
sidebar.ts: Extract `key_codes` to module
Move this to a separate module as we'll probably want to use the same
dictionary of key codes to make other shortcuts.
Also fix some syntax while we're at it.
| -rw-r--r-- | src/key_codes.ts | 6 | ||||
| -rw-r--r-- | src/sidebar.ts | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/key_codes.ts b/src/key_codes.ts new file mode 100644 index 0000000..301b44a --- /dev/null +++ b/src/key_codes.ts @@ -0,0 +1,6 @@ +var key_codes: { [index: string]: number } = { + SLASH: 220, + M: 77 +}; + +export default key_codes; diff --git a/src/sidebar.ts b/src/sidebar.ts index 05e5d22..dbf9cbe 100644 --- a/src/sidebar.ts +++ b/src/sidebar.ts @@ -1,11 +1,7 @@ import { SIDEBAR } from './gmail_css_class'; +import key_codes from './key_codes'; export default function() { - var key_codes: { [index: string]: number } = { - SLASH: 220, - M: 77 - } - var key_buffer: number[] = []; var sidebar: HTMLElement = document.getElementsByClassName(SIDEBAR)[0] as HTMLElement; @@ -33,4 +29,4 @@ export default function() { key_buffer = []; } }); -}) +}; |
