Correctly scroll to video comment
This commit is contained in:
parent
07a982363f
commit
43483d1296
|
@ -83,11 +83,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.highlightedThread = new VideoComment(res.comment)
|
this.highlightedThread = new VideoComment(res.comment)
|
||||||
|
|
||||||
// Scroll to the highlighted thread
|
// Scroll to the highlighted thread
|
||||||
setTimeout(() => {
|
setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0)
|
||||||
// -60 because of the fixed header
|
|
||||||
const scrollY = this.commentHighlightBlock.nativeElement.offsetTop - 60
|
|
||||||
window.scroll(0, scrollY)
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -375,7 +375,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.remoteServerDown = false
|
this.remoteServerDown = false
|
||||||
|
|
||||||
let startTime = urlOptions.startTime || (this.video.userHistory ? this.video.userHistory.currentTime : 0)
|
let startTime = urlOptions.startTime || (this.video.userHistory ? this.video.userHistory.currentTime : 0)
|
||||||
// Don't start the video if we are at the end
|
// If we are at the end of the video, reset the timer
|
||||||
if (this.video.duration - startTime <= 1) startTime = 0
|
if (this.video.duration - startTime <= 1) startTime = 0
|
||||||
|
|
||||||
if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) {
|
if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) {
|
||||||
|
|
Loading…
Reference in New Issue