diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.scss b/client/src/app/videos/+video-watch/comment/video-comment-add.component.scss index e586880fc..dbce744bf 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.scss +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.scss @@ -28,7 +28,7 @@ form { .submit-comment { display: flex; - justify-content: end; + justify-content: flex-end; button { @include peertube-button; diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.html b/client/src/app/videos/+video-watch/comment/video-comments.component.html index 7278f7e57..8871980e9 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.html @@ -3,7 +3,7 @@
Comments
- @@ -24,8 +24,9 @@ [autoLoading]="true" (nearOfBottom)="onNearOfBottom()" > -
+
{ + // -60 because of the fixed header + console.log(this.commentHighlightBlock.nativeElement.offsetTop) + const scrollY = this.commentHighlightBlock.nativeElement.offsetTop - 60 + window.scroll(0, scrollY) + }, 500) + } }, err => this.notificationsService.error(this.i18n('Error'), err.message) 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 498542fff..a760c03e8 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -101,14 +101,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ) this.paramsSub = this.route.params.subscribe(routeParams => { - if (this.player) { - this.player.pause() - } - const uuid = routeParams[ 'uuid' ] // Video did not change if (this.video && this.video.uuid === uuid) return + + if (this.player) this.player.pause() + // Video did change this.videoService .getVideo(uuid) @@ -469,7 +468,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { } private isAutoplay () { - // True by default + // We'll jump to the thread id, so do not play the video + if (this.route.snapshot.params['threadId']) return false + + // Otherwise true by default if (!this.user) return true // Be sure the autoPlay is set to false