(e: PointerEvent)
| 82 | } |
| 83 | |
| 84 | function onPointerMove(e: PointerEvent) { |
| 85 | if (!activeGroup || !source) return; |
| 86 | |
| 87 | const member = findMember(e.target || undefined); |
| 88 | if (!member || member.getAttribute("data-drag-toggle-group") !== activeGroup) return; |
| 89 | |
| 90 | // Engages only when the cursor crosses from the source to a different peer, so tiny wobbles over the source don't trigger |
| 91 | if (member === source || visited.has(member)) return; |
| 92 | |
| 93 | // First crossing engages the drag and toggles the source as part of the operation |
| 94 | if (!engaged) { |
| 95 | engaged = true; |
| 96 | visited.add(source); |
| 97 | if ((source.getAttribute("data-drag-toggle-state") || undefined) === startingState) source.click(); |
| 98 | } |
| 99 | |
| 100 | // Toggle only peers still in the starting state, so we don't flip ones already at the target state |
| 101 | if ((member.getAttribute("data-drag-toggle-state") || undefined) !== startingState) return; |
| 102 | |
| 103 | visited.add(member); |
| 104 | member.click(); |
| 105 | } |
| 106 | |
| 107 | function onPointerUp() { |
| 108 | if (!activeGroup) return; |
nothing calls this directly
no test coverage detected