Skip to content

Commit

Permalink
#1957 Notification Center becomes hidden when zooming with side panel… (
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlyn authored May 17, 2024
1 parent ae47684 commit 8fbf98d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions canvas_modules/common-canvas/src/toolbar/toolbar-sub-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ export function adjustSubAreaPosition(areaRef, containingDivId, expandDirection,

const thisAreaRect = areaRef.getBoundingClientRect();

const outsideBottom = thisAreaRect.bottom - containingDivRect.bottom;
const outsideRight = thisAreaRect.right - containingDivRect.right;
// Calculate the amount that the panel/menu is outside of the containing div
// edges. Positive value means it is outside. Negative is inside.
const outsideBottom = actionItemRect.bottom + thisAreaRect.height - containingDivRect.bottom;

if (expandDirection === "vertical") {
const outsideRight = actionItemRect.left + thisAreaRect.width - containingDivRect.right;

if (outsideBottom > 0) {
const topGap = actionItemRect.top - containingDivRect.top;
const newTop = (topGap > thisAreaRect.height)
Expand All @@ -54,6 +57,8 @@ export function adjustSubAreaPosition(areaRef, containingDivId, expandDirection,
}

} else {
const outsideRight = actionItemRect.right + thisAreaRect.width - containingDivRect.right;

if (outsideBottom > 0) {
const newTop = thisAreaRect.top - outsideBottom - 2;
areaRef.style.top = newTop + "px";
Expand Down

0 comments on commit 8fbf98d

Please sign in to comment.