From 03a078c1c31933aeb3c1e4d6e2a050e48ffe4428 Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 24 Apr 2023 12:50:20 -0600 Subject: [PATCH 1/2] netpyne-143 Fix size of tutorial bubble --- webapp/components/general/TutorialBubble.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/components/general/TutorialBubble.js b/webapp/components/general/TutorialBubble.js index 6b806f9f..f10e0e33 100644 --- a/webapp/components/general/TutorialBubble.js +++ b/webapp/components/general/TutorialBubble.js @@ -41,8 +41,9 @@ const TutorialBubble = ({ const windowHeight = window.innerHeight; const windowWidth = window.innerWidth; - let x = rect1.left + (rect1.width / 2) - (width2 / 2); - let y = (rect1.top - windowHeight) + rect1.height; + // let x = rect1.left + (rect1.width / 2) - (width2 / 2); // bubble is aligned with center of the rectangle + let x = rect1.left; // bubble is aligned with the left of the rectangle + let y = (rect1.top - windowHeight) + rect1.height + rectMargin; // Check if element2 is outside the viewport horizontally if (x + width2 > windowWidth) { @@ -141,7 +142,7 @@ const TutorialBubble = ({ } const targetRect = DOMtarget.getBoundingClientRect(); - const { x, y } = calculateVisiblePosition(targetRect, 150, 300); + const { x, y } = calculateVisiblePosition(targetRect, 400, 184); const hasOtherSteps = requestedTourStep < steps.length; const nextIsVisible = nextDOMtarget?.checkVisibility(); From 0e73a508f36ba6c0c2e3c49bce59923c0e31a280 Mon Sep 17 00:00:00 2001 From: aranega Date: Mon, 24 Apr 2023 12:50:45 -0600 Subject: [PATCH 2/2] natus-143 Fix placement tutorial bubble when overflow on X axis --- webapp/components/general/TutorialBubble.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/components/general/TutorialBubble.js b/webapp/components/general/TutorialBubble.js index f10e0e33..d52741bb 100644 --- a/webapp/components/general/TutorialBubble.js +++ b/webapp/components/general/TutorialBubble.js @@ -47,7 +47,8 @@ const TutorialBubble = ({ // Check if element2 is outside the viewport horizontally if (x + width2 > windowWidth) { - x = rect1.left - width2; + // x = rect1.left - width2; + x = rect1.left - ((x + width2) - windowWidth + rectMargin); } if (x < 0) {