Browse Source

Fix timestamp click

pull/4723/head
Chocobozzz 1 week ago
parent
commit
696b45deb6
No known key found for this signature in database GPG Key ID: 583A612D890159BE
2 changed files with 3 additions and 3 deletions
  1. +1
    -3
      client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts
  2. +2
    -0
      client/src/app/core/renderer/markdown.service.ts

+ 1
- 3
client/src/app/+videos/+video-watch/shared/timestamp-route-transformer.directive.ts 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



+ 2
- 0
client/src/app/core/renderer/markdown.service.ts 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>`
})
}


Loading…
Cancel
Save