diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-07 17:38:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-07 18:14:05 +0200 |
commit | 27bc95867442c772841fb183a625bbda61dede51 (patch) | |
tree | 6fe20951f1109c1f5388d9a681f0df0758d463e0 /client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts | |
parent | 8beea2d37d90e9a12d895f4a9eebc1e532313d8c (diff) | |
download | PeerTube-27bc95867442c772841fb183a625bbda61dede51.tar.gz PeerTube-27bc95867442c772841fb183a625bbda61dede51.tar.zst PeerTube-27bc95867442c772841fb183a625bbda61dede51.zip |
Bidi support
Diffstat (limited to 'client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts | 22 |
1 files changed, 20 insertions, 2 deletions
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 0e1362ad3..c926d8d70 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 | |||
@@ -1,5 +1,18 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' | 2 | import { getLocaleDirection } from '@angular/common' |
3 | import { | ||
4 | Component, | ||
5 | ElementRef, | ||
6 | EventEmitter, | ||
7 | Inject, | ||
8 | Input, | ||
9 | LOCALE_ID, | ||
10 | OnChanges, | ||
11 | OnInit, | ||
12 | Output, | ||
13 | SimpleChanges, | ||
14 | ViewChild | ||
15 | } from '@angular/core' | ||
3 | import { Router } from '@angular/router' | 16 | import { Router } from '@angular/router' |
4 | import { Notifier, User } from '@app/core' | 17 | import { Notifier, User } from '@app/core' |
5 | import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators' | 18 | import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators' |
@@ -37,7 +50,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, | |||
37 | private notifier: Notifier, | 50 | private notifier: Notifier, |
38 | private videoCommentService: VideoCommentService, | 51 | private videoCommentService: VideoCommentService, |
39 | private modalService: NgbModal, | 52 | private modalService: NgbModal, |
40 | private router: Router | 53 | private router: Router, |
54 | @Inject(LOCALE_ID) private localeId: string | ||
41 | ) { | 55 | ) { |
42 | super() | 56 | super() |
43 | } | 57 | } |
@@ -153,6 +167,10 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, | |||
153 | this.form.value['text'] = this.textareaElement.nativeElement.value = '' | 167 | this.form.value['text'] = this.textareaElement.nativeElement.value = '' |
154 | } | 168 | } |
155 | 169 | ||
170 | isRTL () { | ||
171 | return getLocaleDirection(this.localeId) === 'rtl' | ||
172 | } | ||
173 | |||
156 | private addCommentReply (commentCreate: VideoCommentCreate) { | 174 | private addCommentReply (commentCreate: VideoCommentCreate) { |
157 | return this.videoCommentService | 175 | return this.videoCommentService |
158 | .addCommentReply(this.video.id, this.parentComment.id, commentCreate) | 176 | .addCommentReply(this.video.id, this.parentComment.id, commentCreate) |