[ADF-4387] Configuration option to change the dafault viewer zoom (#4645)

* [ADF-4387] Configuration option to change the dafault viewer zoom
This commit is contained in:
arditdomi
2019-04-23 20:34:39 +01:00
committed by Eugenio Romano
parent d52671823e
commit a6552dbb17
7 changed files with 307 additions and 33 deletions

View File

@@ -15,8 +15,18 @@
* limitations under the License.
*/
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation, ElementRef, OnInit, OnDestroy } from '@angular/core';
import {
Component,
Input,
OnChanges,
SimpleChanges,
ViewEncapsulation,
ElementRef,
OnInit,
OnDestroy
} from '@angular/core';
import { ContentService } from '../../services/content.service';
import { AppConfigService } from './../../app-config/app-config.service';
@Component({
selector: 'adf-img-viewer',
@@ -60,8 +70,18 @@ export class ImgViewerComponent implements OnInit, OnChanges, OnDestroy {
private element: HTMLElement;
constructor(
private appConfigService: AppConfigService,
private contentService: ContentService,
private el: ElementRef) {
this.initializeScaling();
}
initializeScaling() {
const scaling = this.appConfigService.get<number>('adf-viewer.image-viewer-scaling', undefined) / 100;
if (scaling) {
this.scaleX = scaling;
this.scaleY = scaling;
}
}
ngOnInit() {