From 696b45deb63bc9f36da9c9ee55c5d4a3a883b87e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 13 Jan 2022 13:48:02 +0100 Subject: Fix timestamp click --- .../+video-watch/shared/timestamp-route-transformer.directive.ts | 4 +--- client/src/app/core/renderer/markdown.service.ts | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts b/client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts index 91fe5bf5d..ef9f5a59f 100644 --- a/client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts +++ b/client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts @@ -11,13 +11,11 @@ export class TimestampRouteTransformerDirective { const target = $event.target as HTMLLinkElement if (target.hasAttribute('href') !== true) return + if (!target.classList.contains('video-timestamp')) return const ngxLink = document.createElement('a') ngxLink.href = target.getAttribute('href') - // we only care about reflective links - if (ngxLink.host !== window.location.host) return - const ngxLinkParams = new URLSearchParams(ngxLink.search) if (ngxLinkParams.has('start') !== true) return diff --git a/client/src/app/core/renderer/markdown.service.ts b/client/src/app/core/renderer/markdown.service.ts index a81d99534..42e8c4a88 100644 --- a/client/src/app/core/renderer/markdown.service.ts +++ b/client/src/app/core/renderer/markdown.service.ts @@ -90,6 +90,8 @@ export class MarkdownService { url: buildVideoLink({ shortUUID: videoShortUUID }), startTime: t }) + + // Sync class name with timestamp-route-transformer directive return `${str}` }) } -- cgit v1.2.3