Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
finished, with adding also border-radius in the count
Browse files Browse the repository at this point in the history
  • Loading branch information
Laaouatni committed Aug 21, 2022
1 parent 75c8d51 commit 27236ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default function calcolatePopupArrowXposition(_x, _this) {
} else if (_x <= _this.parentPosition.x) {
return {
popup: _this.parentPosition.x + _this.padding,
arrow: _this.arrowX - (_this.parentPosition.x - _x),
arrow:
_this.arrowX -
(_this.parentPosition.x - _x) +
_this.padding +
_this.radiusPopup,
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default function calcolatePopupArrowYposition(_y, _this) {
} else if (_y < _this.parentPosition.y) {
return {
popup: _this.parentPosition.y + _this.padding,
arrow: _this.arrowY - (_this.parentPosition.y - _y) + _this.padding,
arrow:
_this.arrowY -
(_this.parentPosition.y - _y) +
_this.padding +
_this.radiusPopup
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class UpdatePopup {
};

this.padding = 8;
this.radiusPopup = window.getComputedStyle(this.popup).borderRadius.split("px")[0] ?? 0;
}

update() {
Expand Down

0 comments on commit 27236ea

Please sign in to comment.