diff options
| author | Henry Jameson <me@hjkos.com> | 2022-07-31 12:35:48 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-07-31 12:35:48 +0300 |
| commit | fddb531ed20b31c44e6911418e7bbb884836c40a (patch) | |
| tree | 37a8f9aea2002e893d605d64f8941ff1520059b6 /src/components/popover | |
| parent | 0cbfcb99a9ffaf771adbe37320bba157019f65ff (diff) | |
--fix
Diffstat (limited to 'src/components/popover')
| -rw-r--r-- | src/components/popover/popover.js | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js index 58f7126d..d2af59fe 100644 --- a/src/components/popover/popover.js +++ b/src/components/popover/popover.js @@ -104,21 +104,25 @@ const Popover = { // What are the screen bounds for the popover? Viewport vs container // when using viewport, using default margin values to dodge the navbar - const xBounds = this.boundTo && this.boundTo.x === 'container' ? { - min: parentScreenBox.left + (margin.left || 0), - max: parentScreenBox.right - (margin.right || 0) - } : { - min: 0 + (margin.left || 10), - max: window.innerWidth - (margin.right || 10) - } - - const yBounds = this.boundTo && this.boundTo.y === 'container' ? { - min: parentScreenBox.top + (margin.top || 0), - max: parentScreenBox.bottom - (margin.bottom || 0) - } : { - min: 0 + (margin.top || 50), - max: window.innerHeight - (margin.bottom || 5) - } + const xBounds = this.boundTo && this.boundTo.x === 'container' + ? { + min: parentScreenBox.left + (margin.left || 0), + max: parentScreenBox.right - (margin.right || 0) + } + : { + min: 0 + (margin.left || 10), + max: window.innerWidth - (margin.right || 10) + } + + const yBounds = this.boundTo && this.boundTo.y === 'container' + ? { + min: parentScreenBox.top + (margin.top || 0), + max: parentScreenBox.bottom - (margin.bottom || 0) + } + : { + min: 0 + (margin.top || 50), + max: window.innerHeight - (margin.bottom || 5) + } let horizOffset = 0 let vertOffset = 0 |
