diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-13 13:48:02 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-13 13:48:02 +0100 |
commit | 696b45deb63bc9f36da9c9ee55c5d4a3a883b87e (patch) | |
tree | 35c0a134cb90c9226253cbf8a89aa16040f6a629 /client/src | |
parent | d7b052ff4e5604043cd4405ed400f314d0e9a412 (diff) | |
download | PeerTube-696b45deb63bc9f36da9c9ee55c5d4a3a883b87e.tar.gz PeerTube-696b45deb63bc9f36da9c9ee55c5d4a3a883b87e.tar.zst PeerTube-696b45deb63bc9f36da9c9ee55c5d4a3a883b87e.zip |
Fix timestamp click
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts | 4 | ||||
-rw-r--r-- | client/src/app/core/renderer/markdown.service.ts | 2 |
2 files changed, 3 insertions, 3 deletions
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 { | |||
11 | const target = $event.target as HTMLLinkElement | 11 | const target = $event.target as HTMLLinkElement |
12 | 12 | ||
13 | if (target.hasAttribute('href') !== true) return | 13 | if (target.hasAttribute('href') !== true) return |
14 | if (!target.classList.contains('video-timestamp')) return | ||
14 | 15 | ||
15 | const ngxLink = document.createElement('a') | 16 | const ngxLink = document.createElement('a') |
16 | ngxLink.href = target.getAttribute('href') | 17 | ngxLink.href = target.getAttribute('href') |
17 | 18 | ||
18 | // we only care about reflective links | ||
19 | if (ngxLink.host !== window.location.host) return | ||
20 | |||
21 | const ngxLinkParams = new URLSearchParams(ngxLink.search) | 19 | const ngxLinkParams = new URLSearchParams(ngxLink.search) |
22 | if (ngxLinkParams.has('start') !== true) return | 20 | if (ngxLinkParams.has('start') !== true) return |
23 | 21 | ||
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 { | |||
90 | url: buildVideoLink({ shortUUID: videoShortUUID }), | 90 | url: buildVideoLink({ shortUUID: videoShortUUID }), |
91 | startTime: t | 91 | startTime: t |
92 | }) | 92 | }) |
93 | |||
94 | // Sync class name with timestamp-route-transformer directive | ||
93 | return `<a class="video-timestamp" href="${url}">${str}</a>` | 95 | return `<a class="video-timestamp" href="${url}">${str}</a>` |
94 | }) | 96 | }) |
95 | } | 97 | } |