Skip to content

Commit 36de0a5

Browse files
author
Chris K
committed
DFL-3545 Streamlined list of event listener in the JS tooltip
1 parent 941f252 commit 36de0a5

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

src/ecma-debugger/eventlisteners/evlisteners.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
{
1313
margin: 0;
1414
margin-top: -13px;
15+
white-space: pre;
16+
min-width: 180px;
1517
}
1618

1719
.list-selected-node
@@ -58,6 +60,7 @@
5860
.ev-type
5961
{
6062
font: inherit;
63+
position: relative;
6164
}
6265

6366
.ev-listener-tooltip .ev-type,
@@ -76,7 +79,17 @@
7679

7780
.ev-phase
7881
{
79-
float: right;
82+
/*
83+
Propably an expensive way to right align text. But a common float causes an unstable
84+
box with horizontal scrollbars which disappears on hover with an ugly jumping tooltip.
85+
*/
86+
position: absolute;
87+
left: 0;
88+
top: 0;
89+
width: 100%;
90+
box-sizing: border-box;
91+
padding-right: 8px;
92+
text-align: right;
8093
font-style: italic;
8194
color: hsl(0, 0%, 50%);
8295
}

src/ui-scripts/tooltip/tooltip.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,7 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected";
276276
_cur_ctx.last_handler_ele.getAttribute(DATA_TOOLTIP_TEXT),
277277
"class", "basic-tooltip"];
278278

279-
if (content)
280-
{
281-
_cur_ctx.tooltip_ele.scrollTop = 0;
282-
_cur_ctx.tooltip_ele.scrollLeft = 0;
283-
ret = typeof content == "string"
284-
? (_cur_ctx.tooltip_ele.textContent = content)
285-
: _cur_ctx.tooltip_ele.clearAndRender(content);
286-
}
279+
_cur_ctx.tooltip_ele.innerHTML = "";
287280

288281
if (!box && _cur_ctx.last_box)
289282
{
@@ -391,8 +384,16 @@ Tooltips.CSS_TOOLTIP_SELECTED = "tooltip-selected";
391384
}
392385
}
393386
}
394-
}
395387

388+
if (content)
389+
{
390+
_cur_ctx.tooltip_ele.scrollTop = 0;
391+
_cur_ctx.tooltip_ele.scrollLeft = 0;
392+
ret = typeof content == "string"
393+
? (_cur_ctx.tooltip_ele.textContent = content)
394+
: _cur_ctx.tooltip_ele.clearAndRender(content);
395+
}
396+
}
396397
return ret;
397398
};
398399

0 commit comments

Comments
 (0)