From 6f02515e2aff2a8750ad3515b23b345f01c64ab2 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 2 Apr 2020 17:55:03 +0200 Subject: Enlarge right column in video-edit on small screens --- .../src/app/shared/images/preview-upload.component.html | 6 ++---- .../src/app/shared/images/preview-upload.component.scss | 6 ++++-- client/src/app/shared/images/preview-upload.component.ts | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/images/preview-upload.component.html b/client/src/app/shared/images/preview-upload.component.html index 5e1d5211b..7c3a2b588 100644 --- a/client/src/app/shared/images/preview-upload.component.html +++ b/client/src/app/shared/images/preview-upload.component.html @@ -1,13 +1,11 @@
- -
(extensions: {{ allowedExtensionsMessage }}, max size: {{ maxVideoImageSize | bytes }})
diff --git a/client/src/app/shared/images/preview-upload.component.scss b/client/src/app/shared/images/preview-upload.component.scss index 257060239..8f3522115 100644 --- a/client/src/app/shared/images/preview-upload.component.scss +++ b/client/src/app/shared/images/preview-upload.component.scss @@ -16,11 +16,13 @@ } .preview { - border: 2px solid grey; + object-fit: cover; border-radius: 4px; + max-width: 100%; &.no-image { - background-color: #ececec; + border: 2px solid grey; + background-color: var(--mainBackgroundColor); } } } diff --git a/client/src/app/shared/images/preview-upload.component.ts b/client/src/app/shared/images/preview-upload.component.ts index 85a2173e9..7519734ba 100644 --- a/client/src/app/shared/images/preview-upload.component.ts +++ b/client/src/app/shared/images/preview-upload.component.ts @@ -3,6 +3,8 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' import { ServerService } from '@app/core' import { ServerConfig } from '@shared/models' +import { BytesPipe } from 'ngx-pipes' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-preview-upload', @@ -24,14 +26,20 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor { imageSrc: SafeResourceUrl allowedExtensionsMessage = '' + maxSizeText: string private serverConfig: ServerConfig + private bytesPipe: BytesPipe private file: Blob constructor ( private sanitizer: DomSanitizer, - private serverService: ServerService - ) {} + private serverService: ServerService, + private i18n: I18n + ) { + this.bytesPipe = new BytesPipe() + this.maxSizeText = this.i18n('max size') + } get videoImageExtensions () { return this.serverConfig.video.image.extensions @@ -41,6 +49,10 @@ export class PreviewUploadComponent implements OnInit, ControlValueAccessor { return this.serverConfig.video.image.size.max } + get maxVideoImageSizeInBytes () { + return this.bytesPipe.transform(this.maxVideoImageSize) + } + ngOnInit () { this.serverConfig = this.serverService.getTmpConfig() this.serverService.getConfig() -- cgit v1.2.3