]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
Speedup embed first paint
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / comment / video-comment-add.component.ts
index ac1d02d940dfafc20dcc9f6b08267b2c52348384..1be96ad9e85b5d96551db98254e21fc01a810271 100644 (file)
@@ -26,9 +26,10 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
   @Input() focusOnInit = false
 
   @Output() commentCreated = new EventEmitter<VideoCommentCreate>()
+  @Output() cancel = new EventEmitter()
 
-  @ViewChild('visitorModal') visitorModal: NgbModal
-  @ViewChild('textarea') textareaElement: ElementRef
+  @ViewChild('visitorModal', { static: true }) visitorModal: NgbModal
+  @ViewChild('textarea', { static: true }) textareaElement: ElementRef
 
   addingComment = false
 
@@ -136,6 +137,10 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
     this.router.navigate([ '/login' ])
   }
 
+  cancelCommentReply () {
+    this.cancel.emit(null)
+  }
+
   private addCommentReply (commentCreate: VideoCommentCreate) {
     return this.videoCommentService
       .addCommentReply(this.video.id, this.parentComment.id, commentCreate)