aboutsummaryrefslogtreecommitdiff
path: root/src/components/popover/popover.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-05-20 00:56:23 +0300
committerHenry Jameson <me@hjkos.com>2022-05-20 00:56:23 +0300
commitfd831a27f4e9c6bcd5c40f3449d63546fba2560d (patch)
treebc8762b6ad3e1d9cb73d94c12ba0543a52ba4a94 /src/components/popover/popover.js
parentc83657a072dc0d6e77a9c866147094099fb5dc24 (diff)
experimental disjointed popups
Diffstat (limited to 'src/components/popover/popover.js')
-rw-r--r--src/components/popover/popover.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index a30a37c9..db283ef0 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -43,6 +43,7 @@ const Popover = {
methods: {
containerBoundingClientRect () {
const container = this.boundToSelector ? this.$el.closest(this.boundToSelector) : this.$el.offsetParent
+ console.log(container)
return container.getBoundingClientRect()
},
updateStyles () {
@@ -125,10 +126,17 @@ const Popover = {
// Note, separate translateX and translateY avoids blurry text on chromium,
// single translate or translate3d resulted in blurry text.
+ console.log(translateX + screenBox.x + screenBox.width)
+ console.log(Math.round(parentBounds.width))
this.styles = {
opacity: 1,
- transform: `translateX(${Math.round(translateX)}px) translateY(${Math.round(translateY)}px)`
+ // transform: `translateX(${Math.round(translateX)}px) translateY(${Math.round(translateY)}px)`
+ left: `${Math.round(translateX + screenBox.x + screenBox.width / 2)}px`,
+ top: `${Math.round(translateY + screenBox.y + screenBox.height / 2)}px`,
+ maxWidth: `${Math.round(parentBounds.width)}px`,
+ position: 'fixed'
}
+ console.log(this.styles)
},
showPopover () {
const wasHidden = this.hidden