Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ace-internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ export namespace Ace {
dragDelay: number;
dragEnabled: boolean;
focusTimeout: number;
tooltipFollowsMouse: boolean;
}

interface EditorOptions extends EditSessionOptions,
Expand Down Expand Up @@ -1629,7 +1628,6 @@ declare module "./src/mouse/mouse_event" {
declare module "./src/mouse/mouse_handler" {

export interface MouseHandler {
$tooltipFollowsMouse?: boolean,
cancelDrag?: boolean
//from DefaultHandlers
$clickSelection?: Ace.Range,
Expand All @@ -1638,6 +1636,7 @@ declare module "./src/mouse/mouse_handler" {
select?: () => void
$lastScroll?: { t: number, vx: number, vy: number, allowed: number }
selectEnd?: () => void
$tooltip?: Ace.GutterTooltip
}
}

Expand Down
1 change: 0 additions & 1 deletion ace.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ declare module "ace-code" {
dragDelay: number;
dragEnabled: boolean;
focusTimeout: number;
tooltipFollowsMouse: boolean;
}
interface EditorOptions extends EditSessionOptions, MouseHandlerOptions, VirtualRendererOptions {
selectionStyle: "fullLine" | "screenLine" | "text" | "line";
Expand Down
15 changes: 7 additions & 8 deletions src/autocomplete/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,27 +370,24 @@ class AcePopup {
renderer.$maxPixelHeight = null;
}

el.style.display = "";
var rootRect = el.offsetParent && el.offsetParent.getBoundingClientRect();


if (anchor === "top") {
el.style.top = "";
el.style.bottom = (screenHeight + scrollBarSize - dims.bottom)
- (rootRect ? screenHeight + scrollBarSize - rootRect.bottom : 0)+ "px";
el.style.bottom = (screenHeight + scrollBarSize - dims.bottom) + "px";
popup.isTopdown = false;
} else {
el.style.top = (dims.top - (rootRect ? rootRect.top : 0)) + "px";
el.style.top = dims.top + "px";
el.style.bottom = "";
popup.isTopdown = true;
}

el.style.display = "";

var left = pos.left;
if (left + el.offsetWidth > screenWidth)
left = screenWidth - el.offsetWidth;

el.style.left = (left - (rootRect ? rootRect.left : 0)) + "px";
el.style.left = left + "px";
el.style.right = "";

if (!popup.isOpen) {
Expand All @@ -401,6 +398,8 @@ class AcePopup {

popup.anchorPos = pos;
popup.anchor = anchor;

dom.$fixPositionBug(el);

return true;
};
Expand Down Expand Up @@ -472,7 +471,7 @@ dom.importCssString(`
width: 300px;
z-index: 200000;
border: 1px lightgray solid;
position: absolute;
position: fixed;
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
line-height: 1.4;
background: #fefefe;
Expand Down
2 changes: 1 addition & 1 deletion src/css/editor-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ module.exports = `
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
color: black;
padding: 3px 4px;
position: absolute;
position: fixed;
z-index: 999999;
box-sizing: border-box;
cursor: default;
Expand Down
1 change: 0 additions & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3121,7 +3121,6 @@ config.defineOptions(Editor.prototype, "editor", {
dragDelay: "$mouseHandler",
dragEnabled: "$mouseHandler",
focusTimeout: "$mouseHandler",
tooltipFollowsMouse: "$mouseHandler",

firstLineNumber: "session",
overwrite: "session",
Expand Down
4 changes: 0 additions & 4 deletions src/ext/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ var optionGroups = {
},
"Keyboard Accessibility Mode": {
path: "enableKeyboardAccessibility"
},
"Gutter tooltip follows mouse": {
path: "tooltipFollowsMouse",
defaultValue: true
}
}
};
Expand Down
15 changes: 5 additions & 10 deletions src/keyboard/gutter_handler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";

var keys = require('../lib/keys');
var GutterTooltip = require("../mouse/default_gutter_handler").GutterTooltip;

class GutterKeyboardHandler {
constructor(editor) {
Expand All @@ -13,7 +12,7 @@ class GutterKeyboardHandler {
this.activeRowIndex = null;
this.activeLane = null;

this.annotationTooltip = new GutterTooltip(this.editor);
this.annotationTooltip = this.editor.$mouseHandler.$tooltip;
}

addListener() {
Expand All @@ -34,7 +33,7 @@ class GutterKeyboardHandler {
e.preventDefault();

if (e.keyCode === keys["escape"])
this.annotationTooltip.hideTooltip();
this.annotationTooltip.hide();

return;
}
Expand Down Expand Up @@ -186,12 +185,8 @@ class GutterKeyboardHandler {
return;

case "annotation":
var gutterElement = this.lines.cells[this.activeRowIndex].element.childNodes[2];
var rect = gutterElement.getBoundingClientRect();
var style = this.annotationTooltip.getElement().style;
style.left = rect.right + "px";
style.top = rect.bottom + "px";
this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));
this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));
this.annotationTooltip.$fromKeyboard = true;
break;
}
return;
Expand All @@ -213,7 +208,7 @@ class GutterKeyboardHandler {
}

if (this.annotationTooltip.isOpen)
this.annotationTooltip.hideTooltip();
this.annotationTooltip.hide();

return;
}
Expand Down
Loading
Loading