Skip to content
Permalink
Browse files

draft arrows navigation

  • Loading branch information...
Manuel-777 committed Sep 21, 2019
1 parent 4c66877 commit 0e3f247e0de59919d93e25cf0524f3087ab2e806
Showing with 14 additions and 0 deletions.
  1. +14 −0 window_main/draft-details.js
@@ -42,6 +42,7 @@ function getPickedCards(draft, draftPosition) {
return cards;
}

let arrowsChange = null;
//
exports.openDraft = openDraft;
function openDraft(id, draftPosition = 1) {
@@ -88,6 +89,19 @@ function openDraft(id, draftPosition = 1) {
navCont.appendChild(nextNav);
cont.appendChild(navCont);

window.addEventListener("keydown", function(event) {
const key = event.key;
console.log(key);
if (key == "ArrowLeft") {
draftPosition -= 1;
openDraft(id, draftPosition);
} else if (key == "ArrowRight") {
draftPosition += 1;
openDraft(id, draftPosition);
}
window.removeEventListener("keydown", arguments.callee);
});

const title = createDiv(
["draft_title"],
"Pack " + (pa + 1) + ", Pick " + (pi + 1)

0 comments on commit 0e3f247

Please sign in to comment.
You can’t perform that action at this time.