aboutsummaryrefslogtreecommitdiffstats
path: root/src/sidebar.ts
blob: 1af0cf5cf4677dc05ad13a9584a87a0bcf08b601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { SIDEBAR } from './gmail_css_class';
import key_codes from './key_codes';
import multi_key_command from './multi_key_command';

export default function() {
	var key_buffer: number[] = [];

	var sidebar: HTMLElement = document.getElementsByClassName(SIDEBAR)[0] as HTMLElement;

	multi_key_command(
		document,
		[key_codes.SLASH, key_codes.M],
		function() {
			if (sidebar.offsetParent === null) {
				sidebar.style.display = 'block';
			}
			else {
				sidebar.style.display = 'none';
			}
		}
	);
};