Skip to content

Commit

Permalink
Fix: account for vertical position bottom in placement of popup (#581)
Browse files Browse the repository at this point in the history
use parent height to determine bottom style property for popup
  • Loading branch information
yannickm95 authored Dec 6, 2023
1 parent 62a6d2a commit f88e659
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/html/includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@ var _MiniProfiler = (function() {
var px = button.offsetTop - 1,
// position next to the button we clicked
windowHeight = window.innerHeight,
maxHeight = windowHeight - px - 40; // make sure the popup doesn't extend below the fold
maxHeight = windowHeight - px - 40, // make sure the popup doesn't extend below the fold
pxVertical = options.renderVerticalPosition === 'bottom' ? button.offsetParent.clientHeight - 21 - px : px;

popup.style[options.renderVerticalPosition] = "".concat(px, "px");
popup.style[options.renderVerticalPosition] = "".concat(pxVertical, "px");
popup.style.maxHeight = "".concat(maxHeight, "px");
popup.style[options.renderHorizontalPosition] = "".concat(
button.offsetWidth - 3,
Expand Down

0 comments on commit f88e659

Please sign in to comment.