We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82ce3d2 commit 370f7c4Copy full SHA for 370f7c4
addon/lint/lint.js
@@ -24,8 +24,10 @@
24
25
function position(e) {
26
if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
27
- tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
28
- tt.style.left = (e.clientX + 5) + "px";
+ var top = Math.max(0, e.clientY - tt.offsetHeight - 5);
+ var left = Math.max(0, Math.min(e.clientX + 5, tt.ownerDocument.defaultView.innerWidth - tt.offsetWidth));
29
+ tt.style.top = top + "px"
30
+ tt.style.left = left + "px";
31
}
32
CodeMirror.on(document, "mousemove", position);
33
position(e);
0 commit comments