summaryrefslogtreecommitdiffstats
path: root/template/standard/rsrc/main.js
blob: a7a424cb9efc394f5043e3121d38138de054b535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//==============================================================================
// Elements which contains the location of the previous and next site
//==============================================================================
const prev = document.getElementById("prev-site");
const next = document.getElementById("next-site");

//==============================================================================
// Handle arrow keys and change the location to the desired direction
//==============================================================================
document.addEventListener("keyup", function(event) {
	if(!event.ctrlKey && !event.shiftKey) {
		(event.keyCode === 37 && prev) && (window.location.href = prev.getAttribute("href"));
		(event.keyCode === 39 && next) && (window.location.href = next.getAttribute("href"));
	}
}, false);