X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fcomment%2Fvideo-comment-add.component.ts;h=1be96ad9e85b5d96551db98254e21fc01a810271;hb=3f9c4955af81702591a6eeb2069f99faf0d2814d;hp=fd85c28f2cb77c1af01ed456fa3ac8149b3e7eee;hpb=73471b1a52f242e86364ffb077ea6cadb3b07ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts index fd85c28f2..1be96ad9e 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts @@ -8,7 +8,6 @@ import { User } from '../../../shared/users' import { Video } from '../../../shared/video/video.model' import { VideoComment } from './video-comment.model' import { VideoCommentService } from './video-comment.service' -import { I18n } from '@ngx-translate/i18n-polyfill' import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' @@ -27,9 +26,10 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit { @Input() focusOnInit = false @Output() commentCreated = new EventEmitter() + @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 @@ -40,8 +40,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit { private videoCommentService: VideoCommentService, private authService: AuthService, private modalService: NgbModal, - private router: Router, - private i18n: I18n + private router: Router ) { super() } @@ -124,7 +123,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit { return this.form.value['text'] } - getUrl () { + getUri () { return window.location.href } @@ -138,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)