Skip to content

Commit 4737771

Browse files
authored
Merge pull request #514 from The-Purple-Warehouse/main
[staging deploy] space bar increments scored
2 parents 1bfdcc9 + ea92f24 commit 4737771

2 files changed

Lines changed: 137 additions & 91 deletions

File tree

package-lock.json

Lines changed: 106 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/scoutingsdk.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4876,13 +4876,44 @@ ${_this.escape(teamNumber)} (Blue ${i + 1})
48764876
}
48774877
};
48784878

4879+
document.addEventListener("keydown", async (e) => {
4880+
if (e.code === "Space") {
4881+
if (
4882+
row
4883+
.closest(".preset")
4884+
?.classList.contains("none")
4885+
) {
4886+
return;
4887+
}
4888+
4889+
if (opt.value !== "fsa") {
4890+
return;
4891+
}
4892+
4893+
e.stopPropagation();
4894+
let cur = parseInt(ecount.innerText) || 0;
4895+
if (opt.max !== undefined && cur >= opt.max) {
4896+
return;
4897+
}
4898+
console.log(opt);
4899+
// console.log(locations);
4900+
values.push(opt.value);
4901+
locations.push(location);
4902+
dcounter++;
4903+
ecount.innerText = cur + 1;
4904+
tally();
4905+
await hub();
4906+
}
4907+
});
4908+
48794909
plus.addEventListener("click", async (e) => {
48804910
e.stopPropagation();
48814911
let cur = parseInt(ecount.innerText) || 0;
48824912
if (opt.max !== undefined && cur >= opt.max) {
48834913
return;
48844914
}
48854915
values.push(opt.value);
4916+
console.log(opt);
48864917
locations.push(location);
48874918
dcounter++;
48884919
ecount.innerText = cur + 1;

0 commit comments

Comments
 (0)