Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75772407
zoom.component.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Aug 4, 04:27
Size
1 KB
Mime Type
text/x-java
Expires
Tue, Aug 6, 04:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19599285
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
zoom.component.ts
View Options
import { Component, OnInit, Input } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { TLN_MULTI_INSTANCE_ZOOM_PARAM, TLN_ZOOM_PARAM } from '../constants';
import { Mapping } from '../route-reader';
import { RouteUpdater } from '../route-updater';
@Component({
selector: 'zoom',
templateUrl: './zoom.component.html',
styleUrls: ['./zoom.component.css']
})
export class ZoomComponent extends RouteUpdater {
@Input() resetButtonOn: boolean = true;
@Input() useViewerZoom: boolean = true;
@Input() sliderOn: boolean = true;
@Input() step: number = 0.25;
zoomFactor: number = 1;
protected mapping: Mapping = { zoomFactor: { param: TLN_ZOOM_PARAM, type: "number" }}
constructor(protected router: Router, protected activatedRoute: ActivatedRoute ) {
super(router, activatedRoute);
}
ngOnInit(){
if (!this.useViewerZoom){
this.mapping['zoomFactor']['param'] = TLN_MULTI_INSTANCE_ZOOM_PARAM;
}
super.ngOnInit();
}
private formatLabel(value: number): string {
return Math.round(value * 100) + '%';
}
private setZoomFactor(newZoomFactor: number){
console.log(newZoomFactor);
if (newZoomFactor > 0){
this.zoomFactor = Math.round(newZoomFactor*100)/100;
} else {
this.zoomFactor = this.zoomFactor/2
}
this.updateParams();
}
}
Event Timeline
Log In to Comment