From 27bc95867442c772841fb183a625bbda61dede51 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 7 Jun 2021 17:38:31 +0200 Subject: Bidi support --- .../comment/video-comment-add.component.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts') 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 @@ import { Observable } from 'rxjs' -import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' +import { getLocaleDirection } from '@angular/common' +import { + Component, + ElementRef, + EventEmitter, + Inject, + Input, + LOCALE_ID, + OnChanges, + OnInit, + Output, + SimpleChanges, + ViewChild +} from '@angular/core' import { Router } from '@angular/router' import { Notifier, User } from '@app/core' import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators' @@ -37,7 +50,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, private notifier: Notifier, private videoCommentService: VideoCommentService, private modalService: NgbModal, - private router: Router + private router: Router, + @Inject(LOCALE_ID) private localeId: string ) { super() } @@ -153,6 +167,10 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, this.form.value['text'] = this.textareaElement.nativeElement.value = '' } + isRTL () { + return getLocaleDirection(this.localeId) === 'rtl' + } + private addCommentReply (commentCreate: VideoCommentCreate) { return this.videoCommentService .addCommentReply(this.video.id, this.parentComment.id, commentCreate) -- cgit v1.2.3