Responded to suggestions by nightwing

Removed style changes (no style changes are part of the PR).

Only change now should be that we create a <div/> element instead of a <pre/> element.
This commit is contained in:
Chris Ainsley 2014-10-20 21:33:23 +01:00
commit cef48f6887

View file

@ -352,13 +352,12 @@ var Autocomplete = function() {
this.showDocTooltip = function(item) { this.showDocTooltip = function(item) {
if (!this.tooltipNode) { if (!this.tooltipNode) {
this.tooltipNode = item.docHTML ? dom.createElement("div") : dom.createElement("pre"); this.tooltipNode = dom.createElement("div");
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip"; this.tooltipNode.className = "ace_tooltip ace_doc-tooltip";
this.tooltipNode.style.margin = 0; this.tooltipNode.style.margin = 0;
this.tooltipNode.style.pointerEvents = "auto"; this.tooltipNode.style.pointerEvents = "auto";
this.tooltipNode.tabIndex = -1; this.tooltipNode.tabIndex = -1;
this.tooltipNode.onblur = this.blurListener.bind(this); this.tooltipNode.onblur = this.blurListener.bind(this);
} }
var tooltipNode = this.tooltipNode; var tooltipNode = this.tooltipNode;
@ -374,8 +373,7 @@ var Autocomplete = function() {
var rect = popup.container.getBoundingClientRect(); var rect = popup.container.getBoundingClientRect();
tooltipNode.style.top = popup.container.style.top; tooltipNode.style.top = popup.container.style.top;
tooltipNode.style.bottom = popup.container.style.bottom; tooltipNode.style.bottom = popup.container.style.bottom;
tooltipNode.style.backgroundImage = "none";
tooltipNode.style.backgroundColor = "#FFFFEE";
if (window.innerWidth - rect.right < 320) { if (window.innerWidth - rect.right < 320) {
tooltipNode.style.right = window.innerWidth - rect.left + "px"; tooltipNode.style.right = window.innerWidth - rect.left + "px";
tooltipNode.style.left = ""; tooltipNode.style.left = "";
@ -384,10 +382,6 @@ var Autocomplete = function() {
tooltipNode.style.right = ""; tooltipNode.style.right = "";
} }
tooltipNode.style.display = "block"; tooltipNode.style.display = "block";
tooltipNode.style.maxWidth = "500px";
tooltipNode.style.whiteSpace = "normal";
tooltipNode.style.wordWrap = "normal";
tooltipNode.style.textAlign = "left";
}; };
this.hideDocTooltip = function() { this.hideDocTooltip = function() {