merch sizing-guide: clear table on click outside
All checks were successful
/ build (push) Successful in 8s
All checks were successful
/ build (push) Successful in 8s
This commit is contained in:
parent
0411c33e4d
commit
08c4289b73
1 changed files with 13 additions and 2 deletions
|
|
@ -1146,7 +1146,6 @@
|
||||||
const dimension = cell.dataset.dim;
|
const dimension = cell.dataset.dim;
|
||||||
|
|
||||||
document.querySelectorAll('td.val:not(.empty)').forEach(match => {
|
document.querySelectorAll('td.val:not(.empty)').forEach(match => {
|
||||||
match.style.backgroundColor = ``
|
|
||||||
match.dataset.diff = '';
|
match.dataset.diff = '';
|
||||||
match.classList.remove('highlighted')
|
match.classList.remove('highlighted')
|
||||||
match.classList.remove('currentDimension')
|
match.classList.remove('currentDimension')
|
||||||
|
|
@ -1170,6 +1169,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectCellPlus(e) {
|
function selectCellPlus(e) {
|
||||||
|
e.stopPropagation();
|
||||||
const cell = e.target;
|
const cell = e.target;
|
||||||
const group = cell.parentElement.parentElement;
|
const group = cell.parentElement.parentElement;
|
||||||
const col = cell.dataset.col;
|
const col = cell.dataset.col;
|
||||||
|
|
@ -1185,7 +1185,6 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
document.querySelectorAll('td.val:not(.empty)').forEach(match => {
|
document.querySelectorAll('td.val:not(.empty)').forEach(match => {
|
||||||
match.style.backgroundColor = ``
|
|
||||||
match.dataset.diff = '';
|
match.dataset.diff = '';
|
||||||
match.classList.remove('highlighted')
|
match.classList.remove('highlighted')
|
||||||
match.classList.remove('currentDimension')
|
match.classList.remove('currentDimension')
|
||||||
|
|
@ -1238,6 +1237,18 @@
|
||||||
|
|
||||||
cell.addEventListener('pointerdown', selectCellPlus);
|
cell.addEventListener('pointerdown', selectCellPlus);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// disable select on click outside value cell
|
||||||
|
document.addEventListener('pointerdown', e => {
|
||||||
|
document.querySelectorAll('td.val:not(.empty)').forEach(match => {
|
||||||
|
match.dataset.diff = '';
|
||||||
|
match.classList.remove('highlighted')
|
||||||
|
match.classList.remove('currentDimension')
|
||||||
|
});
|
||||||
|
document.querySelectorAll('td.dimension').forEach(match => {
|
||||||
|
match.classList.remove('currentDimension');
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue