summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-04-17 23:53:05 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-04-17 23:53:05 +0900
commit8c4662e6e583091ea030de97ed035dac070d2501 (patch)
tree039da3ae5a7c532c9819f46cf7bf3c302884f58a /src/client/components
parentdisplay online status (diff)
downloadsharkey-8c4662e6e583091ea030de97ed035dac070d2501.tar.gz
sharkey-8c4662e6e583091ea030de97ed035dac070d2501.tar.bz2
sharkey-8c4662e6e583091ea030de97ed035dac070d2501.zip
Improve tooltip behaviour
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/ui/tooltip.vue10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/components/ui/tooltip.vue b/src/client/components/ui/tooltip.vue
index b220fe5d8c..de8c02ad4a 100644
--- a/src/client/components/ui/tooltip.vue
+++ b/src/client/components/ui/tooltip.vue
@@ -39,7 +39,7 @@ export default defineComponent({
const contentHeight = this.$refs.content.offsetHeight;
let left = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
- let top = rect.top + window.pageYOffset + this.source.offsetHeight;
+ let top = rect.top + window.pageYOffset - contentHeight;
left -= (this.$el.offsetWidth / 2);
@@ -47,9 +47,9 @@ export default defineComponent({
left = window.innerWidth - contentWidth + window.pageXOffset - 1;
}
- if (top + contentHeight - window.pageYOffset > window.innerHeight) {
- top = rect.top + window.pageYOffset - contentHeight;
- this.$refs.content.style.transformOrigin = 'center bottom';
+ if (top - window.pageYOffset < 0) {
+ top = rect.top + window.pageYOffset + this.source.offsetHeight;
+ this.$refs.content.style.transformOrigin = 'center top';
}
this.$el.style.left = left + 'px';
@@ -81,6 +81,6 @@ export default defineComponent({
text-align: center;
border-radius: 4px;
pointer-events: none;
- transform-origin: center top;
+ transform-origin: center bottom;
}
</style>