Fix timestamp click
This commit is contained in:
parent
d7b052ff4e
commit
696b45deb6
|
@ -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
|
||||
|
||||
|
|
|
@ -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>`
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue