Move function into closure

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 22:41:29 -07:00
parent 48f239470f
commit 63376cb641

View File

@ -12,10 +12,6 @@ function getGridIndex({ parentElement: { dataset: { x }, parentElement: { datase
return { x: +x, y: +y };
}
function getCounterAtGridIndex(x, y) {
return getCell(x, y).querySelector('.counter');
}
function getHex(cell) {
return cell.querySelector('use[href="#hex"]');
}
@ -235,6 +231,10 @@ export default function (svg) {
return svg.querySelector(`g[data-y="${y}"] > g[data-x="${x}"]`);
}
function getCounterAtGridIndex(x, y) {
return getCell(x, y).querySelector('.counter');
}
function getSelected() {
return svg.querySelector(`.counter.selected[data-allegiance][data-number]`);
}