Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/MiniProfiler.Shared/ui/lib/MiniProfiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,15 @@ namespace StackExchange.Profiling {

// is this rendering on the bottom (if no, then is top by default)
if (pos === RenderPosition.BottomLeft || pos === RenderPosition.BottomRight) {
const bottom = window.innerHeight - button.getBoundingClientRect().top - button.offsetHeight + window.scrollY; // get bottom of button
popup.style.bottom = '0';
popup.style.maxHeight = 'calc(100vh - ' + (bottom + 25) + 'px)';
popup.style.top = '';
const maxHeight = Math.max(0, button.getBoundingClientRect().top - 25);
popup.style.maxHeight = `${maxHeight}px`;
} else {
popup.style.top = '0';
popup.style.maxHeight = 'calc(100vh - ' + (button.getBoundingClientRect().top - window.window.scrollY + 25) + 'px)';
popup.style.bottom = '';
const maxHeight = Math.max(0, window.innerHeight - button.getBoundingClientRect().bottom - 25);
popup.style.maxHeight = `${maxHeight}px`;
}
}
return;
Expand Down