From fd831a27f4e9c6bcd5c40f3449d63546fba2560d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 20 May 2022 00:56:23 +0300 Subject: experimental disjointed popups --- src/components/popover/popover.js | 10 +++++++++- src/components/popover/popover.vue | 28 +++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) (limited to 'src/components/popover') 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 diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index c2a3e801..8f6ef2e6 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -11,19 +11,21 @@ > -
- -
+ +
+ +
+
-- cgit v1.2.3-70-g09d2