MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / handleCheck

Function handleCheck

assets/js/checkboxes.js:5–23  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3let lastChecked;
4
5function handleCheck(e) {
6 let inBetween = false;
7
8 if (e.shiftKey && this.checked) {
9 checkboxes.forEach((checkbox) => {
10 console.log(checkbox);
11 if (checkbox === this || checkbox === lastChecked) {
12 inBetween = !inBetween;
13 console.log("Starting to check");
14 }
15
16 if (inBetween) {
17 checkbox.checked = true;
18 }
19 });
20 }
21
22 lastChecked = this;
23}
24
25checkboxes.forEach((checkbox) =>
26 checkbox.addEventListener("click", handleCheck)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected