Add toggle for auto map-centering
This commit is contained in:
@@ -269,7 +269,7 @@ document.querySelectorAll('[name="select-elevation"]').forEach(el => {
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelector('#toggle-grid-vis input').addEventListener('change', function () {
|
||||
document.querySelector('#toggle-grid-vis').addEventListener('change', function () {
|
||||
const svg = document.querySelector('object').contentDocument.querySelector('svg');
|
||||
svg.querySelector('.grid').style.display = this.checked ? 'inline' : 'none';
|
||||
svg.querySelector('#dots').style.display = this.checked ? 'inline' : 'none';
|
||||
|
||||
@@ -192,7 +192,7 @@ function select(data, opts) {
|
||||
|
||||
if (isSelected || !data) return;
|
||||
|
||||
if (opts?.revealCounter) {
|
||||
if (opts?.revealCounter && document.querySelector('#auto-center-map').checked) {
|
||||
const gb = svg.querySelector('.gameboard');
|
||||
if (gb.contains(counter)) manualPan(gb, counter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user