3 options Yes, No, Blank
This commit is contained in:
parent
c80ce1acb8
commit
9987faba08
@ -80,17 +80,25 @@ function renderTable() {
|
|||||||
const td = document.createElement('td');
|
const td = document.createElement('td');
|
||||||
td.className = 'clickable name-col';
|
td.className = 'clickable name-col';
|
||||||
const key = `${date}|${colIdx}`;
|
const key = `${date}|${colIdx}`;
|
||||||
if (data.attendance[key]) {
|
if (data.attendance[key] === true) {
|
||||||
td.innerText = 'Yes';
|
td.innerText = 'Yes';
|
||||||
td.classList.add('yes');
|
td.classList.add('yes');
|
||||||
|
td.classList.remove('no');
|
||||||
|
} else if (data.attendance[key] === 'no') {
|
||||||
|
td.innerText = 'No';
|
||||||
|
td.classList.add('no');
|
||||||
|
td.classList.remove('yes');
|
||||||
} else {
|
} else {
|
||||||
td.innerText = '';
|
td.innerText = '';
|
||||||
|
td.classList.remove('yes', 'no');
|
||||||
}
|
}
|
||||||
td.onclick = () => {
|
td.onclick = () => {
|
||||||
if (data.attendance[key]) {
|
if (!data.attendance[key]) {
|
||||||
delete data.attendance[key];
|
|
||||||
} else {
|
|
||||||
data.attendance[key] = true;
|
data.attendance[key] = true;
|
||||||
|
} else if (data.attendance[key] === true) {
|
||||||
|
data.attendance[key] = 'no';
|
||||||
|
} else if (data.attendance[key] === 'no') {
|
||||||
|
delete data.attendance[key];
|
||||||
}
|
}
|
||||||
saveData();
|
saveData();
|
||||||
renderTable();
|
renderTable();
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
box-shadow: 0 0 0 2px #94897966;
|
box-shadow: 0 0 0 2px #94897966;
|
||||||
}
|
}
|
||||||
.yes { background: #948979; font-weight: bold; color: #222831; }
|
.yes { background: #948979; font-weight: bold; color: #222831; }
|
||||||
|
.no { background: #393E46; color: #948979; font-weight: bold; }
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user