summaryrefslogtreecommitdiff
path: root/packages/frontend/src/directives
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-31 16:41:27 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-03-31 16:41:27 +0900
commit152247bfda62f96e7d3c1be9609692f4cedb5629 (patch)
treeb1c49b111a593ffecbf152fe1249cfa9e97e293f /packages/frontend/src/directives
parentfeat: チャンネルにノートをピン留めできるように (diff)
downloadmisskey-152247bfda62f96e7d3c1be9609692f4cedb5629.tar.gz
misskey-152247bfda62f96e7d3c1be9609692f4cedb5629.tar.bz2
misskey-152247bfda62f96e7d3c1be9609692f4cedb5629.zip
refactor: remove autobind-decorator dep
Diffstat (limited to 'packages/frontend/src/directives')
-rw-r--r--packages/frontend/src/directives/user-preview.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/frontend/src/directives/user-preview.ts b/packages/frontend/src/directives/user-preview.ts
index 2f5936de3d..ae12f2670a 100644
--- a/packages/frontend/src/directives/user-preview.ts
+++ b/packages/frontend/src/directives/user-preview.ts
@@ -1,5 +1,4 @@
import { defineAsyncComponent, Directive, ref } from 'vue';
-import autobind from 'autobind-decorator';
import { popup } from '@/os';
export class UserPreview {
@@ -15,9 +14,16 @@ export class UserPreview {
this.user = user;
this.attach();
+
+ this.show = this.show.bind(this);
+ this.close = this.close.bind(this);
+ this.onMouseover = this.onMouseover.bind(this);
+ this.onMouseleave = this.onMouseleave.bind(this);
+ this.onClick = this.onClick.bind(this);
+ this.attach = this.attach.bind(this);
+ this.detach = this.detach.bind(this);
}
- @autobind
private show() {
if (!document.body.contains(this.el)) return;
if (this.promise) return;
@@ -53,7 +59,6 @@ export class UserPreview {
}, 1000);
}
- @autobind
private close() {
if (this.promise) {
window.clearInterval(this.checkTimer);
@@ -62,34 +67,29 @@ export class UserPreview {
}
}
- @autobind
private onMouseover() {
window.clearTimeout(this.showTimer);
window.clearTimeout(this.hideTimer);
this.showTimer = window.setTimeout(this.show, 500);
}
- @autobind
private onMouseleave() {
window.clearTimeout(this.showTimer);
window.clearTimeout(this.hideTimer);
this.hideTimer = window.setTimeout(this.close, 500);
}
- @autobind
private onClick() {
window.clearTimeout(this.showTimer);
this.close();
}
- @autobind
public attach() {
this.el.addEventListener('mouseover', this.onMouseover);
this.el.addEventListener('mouseleave', this.onMouseleave);
this.el.addEventListener('click', this.onClick);
}
- @autobind
public detach() {
this.el.removeEventListener('mouseover', this.onMouseover);
this.el.removeEventListener('mouseleave', this.onMouseleave);