MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / handleRowClick

Function handleRowClick

codeclash/viewer/static/js/picker.js:63–87  ·  view source on GitHub ↗
(event, gameName)

Source from the content-addressed store, hash-verified

61}
62
63function handleRowClick(event, gameName) {
64 // Check if click is on checkbox or in checkbox area
65 const checkbox = event.target.closest('input[type="checkbox"]');
66 const checkboxCell = event.target.closest(".checkbox-cell");
67
68 if (checkbox || checkboxCell) {
69 // Click is on checkbox or in checkbox area - handle selection
70 event.stopPropagation();
71
72 if (!checkbox) {
73 // Click in checkbox area but not on checkbox - toggle selection
74 toggleGameSelection(gameName);
75 }
76 } else {
77 // Click is anywhere else on the row - open game
78 if (event.button === 1 || event.ctrlKey || event.metaKey) {
79 // Middle click, Ctrl+click, or Cmd+click - open in new tab
80 event.preventDefault();
81 openGameInNewTab(gameName);
82 } else if (event.button === 0) {
83 // Left click - open in same tab
84 openGame(gameName);
85 }
86 }
87}
88
89function toggleSelectAll(selectAllCheckbox) {
90 // Toggle all game checkboxes

Callers

nothing calls this directly

Calls 3

toggleGameSelectionFunction · 0.85
openGameInNewTabFunction · 0.85
openGameFunction · 0.85

Tested by

no test coverage detected