Skip to content

Commit 3861131

Browse files
committed
scope all css to #stackgazer for embedding
1 parent d26e740 commit 3861131

3 files changed

Lines changed: 490 additions & 497 deletions

File tree

src/ui/StackTraceApp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3052,7 +3052,7 @@ export class StackgazerApp {
30523052
this.tooltip = document.createElement('div');
30533053
this.tooltip.className = 'goroutine-tooltip';
30543054
this.tooltip.classList.add('hidden');
3055-
document.body.appendChild(this.tooltip);
3055+
this.container!.appendChild(this.tooltip);
30563056
}
30573057

30583058
private showGoroutinePreviewTooltip(goroutineId: string, event: MouseEvent): void {
@@ -3529,7 +3529,7 @@ export class StackgazerApp {
35293529
textarea.value = combinedText;
35303530
textarea.style.position = 'fixed';
35313531
textarea.style.left = '-9999px';
3532-
document.body.appendChild(textarea);
3532+
this.container!.appendChild(textarea);
35333533

35343534
try {
35353535
textarea.select();
@@ -3672,7 +3672,7 @@ export class StackgazerApp {
36723672
};
36733673
document.addEventListener('keydown', closeOnEscape);
36743674

3675-
document.body.appendChild(modal);
3675+
this.container!.appendChild(modal);
36763676

36773677
// Render the tree
36783678
this.renderAncestryTree(svgContainer, treeData, targetGoroutine);

src/ui/index.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Stackgazer</title>
8-
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E🔍%3C/text%3E%3C/svg%3E">
9-
<link rel="stylesheet" href="styles.css">
8+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E🔍%3C/text%3E%3C/svg%3E">
9+
<link rel="stylesheet" href="styles.css">
10+
<style>
11+
html, body {
12+
margin: 0;
13+
padding: 0;
14+
height: 100%;
15+
overflow: hidden;
16+
}
17+
</style>
1018
</head>
1119

1220
<body>

0 commit comments

Comments
 (0)