aboutsummaryrefslogtreecommitdiff
path: root/src/components/popover
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/popover')
-rw-r--r--src/components/popover/popover.js6
-rw-r--r--src/components/popover/popover.vue5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index a40a9195..695f73b9 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -18,7 +18,9 @@ const Popover = {
// Takes a x/y object and tells how many pixels to offset from
// anchor point on either axis
offset: Object,
- // Additional styles you may want for the popover container
+ // Replaces the classes you may want for the popover container.
+ // Use 'popover-default' in addition to get the default popover
+ // styles with your custom class.
popoverClass: String
},
data () {
@@ -106,7 +108,7 @@ const Popover = {
// single translate or translate3d resulted in blurry text.
this.styles = {
opacity: 1,
- transform: `translateX(${Math.floor(translateX)}px) translateY(${Math.floor(translateY)}px)`
+ transform: `translateX(${Math.round(translateX)}px) translateY(${Math.round(translateY)}px)`
}
},
showPopover () {
diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue
index a271cb1b..5c99c509 100644
--- a/src/components/popover/popover.vue
+++ b/src/components/popover/popover.vue
@@ -14,7 +14,7 @@
ref="content"
:style="styles"
class="popover"
- :class="popoverClass"
+ :class="popoverClass || 'popover-default'"
>
<slot
name="content"
@@ -34,6 +34,9 @@
z-index: 8;
position: absolute;
min-width: 0;
+}
+
+.popover-default {
transition: opacity 0.3s;
box-shadow: 1px 1px 4px rgba(0,0,0,.6);