+
+
{{ text }}
@@ -35,19 +35,43 @@ export default defineComponent({
const rect = this.source.getBoundingClientRect();
- let x = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
- let y = rect.top + window.pageYOffset + this.source.offsetHeight;
+ const contentWidth = this.$refs.content.offsetWidth;
+ const contentHeight = this.$refs.content.offsetHeight;
- x -= (this.$el.offsetWidth / 2);
+ let left = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
+ let top = rect.top + window.pageYOffset + this.source.offsetHeight;
- this.$el.style.left = x + 'px';
- this.$el.style.top = y + 'px';
+ left -= (this.$el.offsetWidth / 2);
+
+ if (left + contentWidth - window.pageXOffset > window.innerWidth) {
+ 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';
+ }
+
+ this.$el.style.left = left + 'px';
+ this.$el.style.top = top + 'px';
});
},
})
diff --git a/src/client/components/widgets.vue b/src/client/components/widgets.vue
new file mode 100644
index 0000000000..23fce7d714
--- /dev/null
+++ b/src/client/components/widgets.vue
@@ -0,0 +1,153 @@
+
+
+
+
+
+ {{ $ts.selectWidget }}
+
+
+ {{ $ts.add }}
+ {{ $ts.close }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/client/directives/tooltip.ts b/src/client/directives/tooltip.ts
index faeeef79a7..2a0a13663c 100644
--- a/src/client/directives/tooltip.ts
+++ b/src/client/directives/tooltip.ts
@@ -4,6 +4,7 @@ import { popup } from '@/os';
const start = isDeviceTouch ? 'touchstart' : 'mouseover';
const end = isDeviceTouch ? 'touchend' : 'mouseleave';
+const delay = 100;
export default {
mounted(el: HTMLElement, binding, vn) {
@@ -47,13 +48,13 @@ export default {
el.addEventListener(start, () => {
clearTimeout(self.showTimer);
clearTimeout(self.hideTimer);
- self.showTimer = setTimeout(show, 300);
+ self.showTimer = setTimeout(show, delay);
}, { passive: true });
el.addEventListener(end, () => {
clearTimeout(self.showTimer);
clearTimeout(self.hideTimer);
- self.hideTimer = setTimeout(self.close, 300);
+ self.hideTimer = setTimeout(self.close, delay);
}, { passive: true });
el.addEventListener('click', () => {
diff --git a/src/client/style.scss b/src/client/style.scss
index 14e8c87314..de548cc9c9 100644
--- a/src/client/style.scss
+++ b/src/client/style.scss
@@ -488,19 +488,6 @@ hr {
transform: scale(0.9);
}
-.zoom-in-top-enter-active,
-.zoom-in-top-leave-active {
- opacity: 1;
- transform: scaleY(1);
- transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
- transform-origin: center top;
-}
-.zoom-in-top-enter-from,
-.zoom-in-top-leave-active {
- opacity: 0;
- transform: scaleY(0);
-}
-
@keyframes blink {
0% { opacity: 1; transform: scale(1); }
30% { opacity: 1; transform: scale(1); }
diff --git a/src/client/ui/chat/index.vue b/src/client/ui/chat/index.vue
index a54e5f97ff..d1579038c7 100644
--- a/src/client/ui/chat/index.vue
+++ b/src/client/ui/chat/index.vue
@@ -10,10 +10,10 @@