MCPcopy Create free account
hub / github.com/TruthHun/BookStack / showTooltip

Function showTooltip

static/editor.md/lib/codemirror/addon/lint/lint.js:15–30  ·  view source on GitHub ↗
(e, content)

Source from the content-addressed store, hash-verified

13 var GUTTER_ID = "CodeMirror-lint-markers";
14
15 function showTooltip(e, content) {
16 var tt = document.createElement("div");
17 tt.className = "CodeMirror-lint-tooltip";
18 tt.appendChild(content.cloneNode(true));
19 document.body.appendChild(tt);
20
21 function position(e) {
22 if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
23 tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
24 tt.style.left = (e.clientX + 5) + "px";
25 }
26 CodeMirror.on(document, "mousemove", position);
27 position(e);
28 if (tt.style.opacity != null) tt.style.opacity = 1;
29 return tt;
30 }
31 function rm(elt) {
32 if (elt.parentNode) elt.parentNode.removeChild(elt);
33 }

Callers 1

showTooltipForFunction · 0.85

Calls 1

positionFunction · 0.85

Tested by

no test coverage detected