Skip to content

Commit 79beb23

Browse files
authored
Merge pull request #721 from MetaCell/fix/netpyne-143
Fix/netpyne 143
2 parents 3d2794f + 0e73a50 commit 79beb23

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

webapp/components/general/TutorialBubble.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ const TutorialBubble = ({
4141
const windowHeight = window.innerHeight;
4242
const windowWidth = window.innerWidth;
4343

44-
let x = rect1.left + (rect1.width / 2) - (width2 / 2);
45-
let y = (rect1.top - windowHeight) + rect1.height;
44+
// let x = rect1.left + (rect1.width / 2) - (width2 / 2); // bubble is aligned with center of the rectangle
45+
let x = rect1.left; // bubble is aligned with the left of the rectangle
46+
let y = (rect1.top - windowHeight) + rect1.height + rectMargin;
4647

4748
// Check if element2 is outside the viewport horizontally
4849
if (x + width2 > windowWidth) {
49-
x = rect1.left - width2;
50+
// x = rect1.left - width2;
51+
x = rect1.left - ((x + width2) - windowWidth + rectMargin);
5052
}
5153

5254
if (x < 0) {
@@ -141,7 +143,7 @@ const TutorialBubble = ({
141143
}
142144

143145
const targetRect = DOMtarget.getBoundingClientRect();
144-
const { x, y } = calculateVisiblePosition(targetRect, 150, 300);
146+
const { x, y } = calculateVisiblePosition(targetRect, 400, 184);
145147

146148
const hasOtherSteps = requestedTourStep < steps.length;
147149
const nextIsVisible = nextDOMtarget?.checkVisibility();

0 commit comments

Comments
 (0)