From 4d43496201900b0cae2e8ade71212043112f0156 Mon Sep 17 00:00:00 2001 From: DanyaPostfactum Date: Thu, 24 Jan 2013 19:19:48 +1000 Subject: [PATCH] Tooltip css tweak --- lib/ace/css/editor.css | 7 ++++++- lib/ace/mouse/default_gutter_handler.js | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index dfcb7aec..b78a7189 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -252,8 +252,9 @@ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); color: black; display: inline-block; + max-width: 500px; padding: 4px; - position: absolute; + position: fixed; z-index: 300; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; @@ -261,6 +262,10 @@ cursor: default; white-space: pre-line; word-wrap: break-word; + line-height: normal; + font-style: normal; + font-weight: normal; + letter-spacing: normal; } .ace_folding-enabled > .ace_gutter-cell { diff --git a/lib/ace/mouse/default_gutter_handler.js b/lib/ace/mouse/default_gutter_handler.js index 90d9747c..ee8f03af 100644 --- a/lib/ace/mouse/default_gutter_handler.js +++ b/lib/ace/mouse/default_gutter_handler.js @@ -66,7 +66,6 @@ function GutterHandler(mouseHandler) { function createTooltip() { tooltip = dom.createElement("div"); tooltip.className = "ace_gutter-tooltip"; - tooltip.style.maxWidth = "500px"; tooltip.style.display = "none"; editor.container.appendChild(tooltip); } @@ -111,10 +110,10 @@ function GutterHandler(mouseHandler) { function moveTooltip(e) { var rect = editor.renderer.$gutter.getBoundingClientRect(); - tooltip.style.left = e.x - rect.left + 15 + "px"; + tooltip.style.left = e.x + 15 + "px"; if (e.y + 3 * editor.renderer.lineHeight + 15 < rect.bottom) { tooltip.style.bottom = ""; - tooltip.style.top = e.y - rect.top + 15 + "px"; + tooltip.style.top = e.y + 15 + "px"; } else { tooltip.style.top = ""; tooltip.style.bottom = rect.bottom - e.y + 5 + "px";