Wire clear-hex dialog back up
This commit is contained in:
parent
28e0188ecd
commit
4c6340f671
@ -373,6 +373,7 @@
|
|||||||
<button
|
<button
|
||||||
style="display: block; margin-left: auto;"
|
style="display: block; margin-left: auto;"
|
||||||
value="confirm"
|
value="confirm"
|
||||||
|
formmethod="dialog"
|
||||||
>Confirm</button>
|
>Confirm</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -226,6 +226,7 @@ export function start(el) {
|
|||||||
|
|
||||||
// For when the pointer leaves the window
|
// For when the pointer leaves the window
|
||||||
document.querySelector('object').addEventListener('pointerout', e => {
|
document.querySelector('object').addEventListener('pointerout', e => {
|
||||||
|
if (clearHexDialog.open) return;
|
||||||
console.log('object pointerout');
|
console.log('object pointerout');
|
||||||
console.log('Left map... CLEARING HOVERS');
|
console.log('Left map... CLEARING HOVERS');
|
||||||
svg.querySelectorAll('.hover').forEach(el => el.classList.remove('hover'));
|
svg.querySelectorAll('.hover').forEach(el => el.classList.remove('hover'));
|
||||||
@ -410,19 +411,15 @@ export function start(el) {
|
|||||||
grid.addEventListener('click', clickHandler);
|
grid.addEventListener('click', clickHandler);
|
||||||
|
|
||||||
const clearHexDialog = document.querySelector('#clear-hex');
|
const clearHexDialog = document.querySelector('#clear-hex');
|
||||||
//clearHexDialog.addEventListener('close', e => {
|
|
||||||
// if (clearHexDialog.returnValue === 'confirm') {
|
|
||||||
// [...top.container.children].forEach(child => {
|
|
||||||
// top.collection.delete(child);
|
|
||||||
// child.remove();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
//clearHexDialog.querySelector('button[value="confirm"]').addEventListener('click', function(e) {
|
clearHexDialog.addEventListener('close', e => {
|
||||||
// e.preventDefault();
|
if (clearHexDialog.returnValue === 'confirm') {
|
||||||
// clearHexDialog.close(this.value);
|
[...frontmost.children].forEach(child => {
|
||||||
//});
|
frontmostStore.delete(child);
|
||||||
|
child.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//gridTop.addEventListener('pointerleave', workaroundForWebKitBug233432(e => {
|
//gridTop.addEventListener('pointerleave', workaroundForWebKitBug233432(e => {
|
||||||
// console.log('pointerleave top', performance.now(), top.cell);
|
// console.log('pointerleave top', performance.now(), top.cell);
|
||||||
@ -443,11 +440,12 @@ export function start(el) {
|
|||||||
//}));
|
//}));
|
||||||
|
|
||||||
//topHex.addEventListener('click', clickHandler);
|
//topHex.addEventListener('click', clickHandler);
|
||||||
//
|
|
||||||
//topHex.addEventListener('contextmenu', e => {
|
grid.addEventListener('contextmenu', e => {
|
||||||
// e.preventDefault();
|
e.preventDefault();
|
||||||
// getSelected() ? sightLine.toggleLock(top.cell) : clearHexDialog.showModal();
|
|
||||||
//});
|
getSelected() ? sightLine.toggleLock(grid.querySelector('.hover')) : clearHexDialog.showModal();
|
||||||
|
});
|
||||||
|
|
||||||
const startingLocations = svg.querySelector('.start-locations');
|
const startingLocations = svg.querySelector('.start-locations');
|
||||||
startingLocations && getUnits(startingLocations).forEach(unit => unit.addEventListener('click', selectOffBoard));
|
startingLocations && getUnits(startingLocations).forEach(unit => unit.addEventListener('click', selectOffBoard));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user