MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / clickHandler

Function clickHandler

src/pages/problems/problems.js:70–90  ·  view source on GitHub ↗

* Click handler for problems page * @param {MouseEvent} e

(e)

Source from the content-addressed store, hash-verified

68 * @param {MouseEvent} e
69 */
70 function clickHandler(e) {
71 const $target = e.target.closest("[data-action='goto']");
72 if (!$target) return;
73 const { action } = $target.dataset;
74
75 if (action === "goto") {
76 const { fileId } = $target.dataset;
77 const annotation = $target.annotation;
78 if (!annotation) return;
79 const row = normalizeIndex(annotation.row);
80 const column = normalizeIndex(annotation.column);
81
82 editorManager.switchFile(fileId);
83 editorManager.editor.gotoLine(row + 1, column);
84 $page.hide();
85
86 setTimeout(() => {
87 editorManager.editor.focus();
88 }, 100);
89 }
90 }
91
92 function collectAnnotations(file) {
93 const annotations = [];

Callers

nothing calls this directly

Calls 3

normalizeIndexFunction · 0.85
focusMethod · 0.80
hideMethod · 0.45

Tested by

no test coverage detected