Skip to content

Commit

Permalink
bluescreen: resets <body> display only when is displayed [Closes #545][
Browse files Browse the repository at this point in the history
…Closes #546]
  • Loading branch information
dg committed Jul 10, 2022
1 parent 3aadc88 commit 6eb6659
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Tracy/BlueScreen/assets/bluescreen.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
--tracy-space: 16px;
}

html, body {
html.tracy-bs-visible,
html.tracy-bs-visible body {
display: block;
overflow: visible;
overflow: auto;
}

#tracy-bs {
Expand Down
6 changes: 5 additions & 1 deletion src/Tracy/BlueScreen/assets/bluescreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class BlueScreen
static init(ajax) {
let blueScreen = document.getElementById('tracy-bs');

document.documentElement.classList.add('tracy-bs-visible');
if (navigator.platform.indexOf('Mac') > -1) {
blueScreen.classList.add('tracy-mac');
}
Expand All @@ -31,7 +32,10 @@ class BlueScreen
});

blueScreen.addEventListener('tracy-toggle', (e) => {
if (!e.target.matches('.tracy-dump *') && e.detail.originalEvent) {
if (e.target.matches('#tracy-bs-toggle')) { // blue screen toggle
document.documentElement.classList.toggle('tracy-bs-visible', !e.detail.collapsed);

} else if (!e.target.matches('.tracy-dump *') && e.detail.originalEvent) { // panel toggle
e.detail.relatedTarget.classList.toggle('tracy-panel-fadein', !e.detail.collapsed);
}
});
Expand Down

0 comments on commit 6eb6659

Please sign in to comment.