diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-08 15:16:54 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-01-09 11:15:15 +0100 |
commit | 43483d12963ed7a82adee2e35a7bcb7e55e54b3e (patch) | |
tree | ec153a900f6d3c4de775ce76340a4c37f070fe4c /client | |
parent | 07a982363fcc6f838dd3f5c2039a2affaea3b0b2 (diff) | |
download | PeerTube-43483d12963ed7a82adee2e35a7bcb7e55e54b3e.tar.gz PeerTube-43483d12963ed7a82adee2e35a7bcb7e55e54b3e.tar.zst PeerTube-43483d12963ed7a82adee2e35a7bcb7e55e54b3e.zip |
Correctly scroll to video comment
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comments.component.ts | 6 | ||||
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index dc62fe5ae..2616820d2 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts | |||
@@ -83,11 +83,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
83 | this.highlightedThread = new VideoComment(res.comment) | 83 | this.highlightedThread = new VideoComment(res.comment) |
84 | 84 | ||
85 | // Scroll to the highlighted thread | 85 | // Scroll to the highlighted thread |
86 | setTimeout(() => { | 86 | setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) |
87 | // -60 because of the fixed header | ||
88 | const scrollY = this.commentHighlightBlock.nativeElement.offsetTop - 60 | ||
89 | window.scroll(0, scrollY) | ||
90 | }, 500) | ||
91 | } | 87 | } |
92 | }, | 88 | }, |
93 | 89 | ||
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 7765c4660..67c5254b3 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -375,7 +375,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
375 | this.remoteServerDown = false | 375 | this.remoteServerDown = false |
376 | 376 | ||
377 | let startTime = urlOptions.startTime || (this.video.userHistory ? this.video.userHistory.currentTime : 0) | 377 | let startTime = urlOptions.startTime || (this.video.userHistory ? this.video.userHistory.currentTime : 0) |
378 | // Don't start the video if we are at the end | 378 | // If we are at the end of the video, reset the timer |
379 | if (this.video.duration - startTime <= 1) startTime = 0 | 379 | if (this.video.duration - startTime <= 1) startTime = 0 |
380 | 380 | ||
381 | if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) { | 381 | if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) { |