Skip to content

Commit

Permalink
Fix #1329 virtual-tour: cannot click on arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Jun 18, 2024
1 parent 3b57f4d commit 625244e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/virtual-tour-plugin/src/ArrowsRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 625244e

Please sign in to comment.