fixup tooltip: use this instead of self

This commit is contained in:
Johann150 2022-12-24 13:48:58 +01:00
parent 85419326f8
commit c02a03168d
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -27,10 +27,10 @@ class TooltipDirective {
if (this.hideTimer != null) return; // already closed or closing if (this.hideTimer != null) return; // already closed or closing
// cancel any pending attempts to show // cancel any pending attempts to show
window.clearTimeout(self.showTimer); window.clearTimeout(this.showTimer);
self.showTimer = null; this.showTimer = null;
self.hideTimer = window.setTimeout(() => { this.hideTimer = window.setTimeout(() => {
this._close?.(); this._close?.();
this._close = null; this._close = null;
}, delay); }, delay);
@ -42,19 +42,19 @@ class TooltipDirective {
if (this.showTimer != null) return; // already showing or going to show if (this.showTimer != null) return; // already showing or going to show
// cancel any pending attempts to hide // cancel any pending attempts to hide
window.clearTimeout(self.hideTimer); window.clearTimeout(this.hideTimer);
self.hideTimer = null; this.hideTimer = null;
self.showTimer = window.setTimeout(() => { this.showTimer = window.setTimeout(() => {
const showing = ref(true); const showing = ref(true);
popup(defineAsyncComponent(() => import('@/components/ui/tooltip.vue')), { popup(defineAsyncComponent(() => import('@/components/ui/tooltip.vue')), {
showing, showing,
text: self.text, text: this.text,
asMfm: self.asMfm, asMfm: this.asMfm,
targetElement: el, targetElement: el,
}, {}, 'closed'); }, {}, 'closed');
self._close = () => { this._close = () => {
showing.value = false; showing.value = false;
}; };
}, delay); }, delay);