Move function into closure

This commit is contained in:
Catalin Constantin Mititiuc 2024-04-27 10:27:54 -07:00
parent 9aada19dbd
commit 0c693a0383

View File

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