From 625244effa7788d07c86d698a140be85f370b265 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Tue, 18 Jun 2024 13:14:00 +0200 Subject: [PATCH] Fix #1329 virtual-tour: cannot click on arrows --- packages/virtual-tour-plugin/src/ArrowsRenderer.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/virtual-tour-plugin/src/ArrowsRenderer.ts b/packages/virtual-tour-plugin/src/ArrowsRenderer.ts index 8086f1e52..1b8ddfb35 100644 --- a/packages/virtual-tour-plugin/src/ArrowsRenderer.ts +++ b/packages/virtual-tour-plugin/src/ArrowsRenderer.ts @@ -53,8 +53,8 @@ export class ArrowsRenderer extends AbstractComponent { this.viewer.addEventListener(events.PositionUpdatedEvent.type, this); this.viewer.addEventListener(events.SizeUpdatedEvent.type, this); this.viewer.addEventListener(events.RenderEvent.type, this); + this.viewer.addEventListener(events.ClickEvent.type, this); - this.container.addEventListener('click', this); this.container.addEventListener('mouseenter', this, true); this.container.addEventListener('mouseleave', this, true); this.container.addEventListener('mousemove', this, true); @@ -65,6 +65,7 @@ export class ArrowsRenderer extends AbstractComponent { this.viewer.removeEventListener(events.PositionUpdatedEvent.type, this); this.viewer.removeEventListener(events.SizeUpdatedEvent.type, this); this.viewer.removeEventListener(events.RenderEvent.type, this); + this.viewer.removeEventListener(events.ClickEvent.type, this); super.destroy(); } @@ -79,8 +80,8 @@ export class ArrowsRenderer extends AbstractComponent { case events.RenderEvent.type: this.render() break; - case 'click': { - const link = this.getTargetLink(e.target as HTMLElement, true); + case events.ClickEvent.type: { + const link = this.getTargetLink((e as events.ClickEvent).data.target, true); if (link) { this.plugin.setCurrentNode(link.nodeId, null, link); }