Commit a15e9911 authored by Daniel Edgecumbe's avatar Daniel Edgecumbe

Add ability to switch tab with cursor keys up/down

parent 88ef6a62
Pipeline #289 passed with stages
in 28 seconds
......@@ -762,4 +762,26 @@ onload = function() {
asyncRequest(`uptime`, processAsyncResponse);
rawAsyncRequest(`${THIS_URL}/_git_status`, dealWithGitStatus);
rawAsyncRequest(`${THIS_URL}/AUTHORS.md`, dealWithAuthorsMd);
document.onkeydown = function(e) {
if ((e.key == "ArrowDown") || (e.key === "ArrowUp")) {
let i;
for (i = 0; i < i < TABS.length; i++) {
if (TABS[i][0] == app.tab) {
break;
}
}
if (e.key === "ArrowDown") { // ArrowDown
i++;
} else { // ArrowUp
i--;
}
i = i % TABS.length;
app.tab = TABS[i][0];
e.preventDefault();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment