1
0
Fork 0

Fix timestamp click

This commit is contained in:
Chocobozzz 2022-01-13 13:48:02 +01:00
parent d7b052ff4e
commit 696b45deb6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -90,6 +90,8 @@ export class MarkdownService {
url: buildVideoLink({ shortUUID: videoShortUUID }),
startTime: t
})
// Sync class name with timestamp-route-transformer directive
return `<a class="video-timestamp" href="${url}">${str}</a>`
})
}