mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 13:38:22 +01:00
Fix link tooltip removal
This commit is contained in:
parent
0b67e7b59a
commit
b311aebc37
@ -16,18 +16,9 @@ class LinkTooltipView {
|
||||
|
||||
this.editorView.dom.addEventListener(
|
||||
"scroll",
|
||||
debounce(
|
||||
() => {
|
||||
if (this.tooltip) {
|
||||
this.tooltip.remove();
|
||||
}
|
||||
this.tooltip = undefined;
|
||||
this.currentLink = undefined;
|
||||
},
|
||||
100,
|
||||
true,
|
||||
),
|
||||
debounce(() => this.destroy(), 100, true),
|
||||
);
|
||||
this.editorView.dom.addEventListener("blur", () => this.destroy());
|
||||
}
|
||||
|
||||
update(view: EditorView) {
|
||||
@ -61,13 +52,17 @@ class LinkTooltipView {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (this.tooltip) {
|
||||
this.tooltip.remove();
|
||||
}
|
||||
this.tooltip = undefined;
|
||||
this.currentLink = undefined;
|
||||
this.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
if (this.tooltip) {
|
||||
this.tooltip.remove();
|
||||
}
|
||||
this.tooltip = undefined;
|
||||
this.currentLink = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function linkTooltip(): Plugin {
|
||||
|
Loading…
x
Reference in New Issue
Block a user