forked from FoundKeyGang/FoundKey
fixup tooltip: use this instead of self
This commit is contained in:
parent
85419326f8
commit
c02a03168d
1 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue