Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61029208
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
Sat, May 4, 02:17
Size
1016 B
Mime Type
text/x-java
Expires
Mon, May 6, 02:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17455082
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
zoom.component.ts
View Options
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { 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 {
private readonly increment: number = 0.25;
private readonly decrement: number = this.increment*-1;
zoomFactor: number = 1;
protected mapping: Mapping = { zoomFactor: { param: TLN_ZOOM_PARAM, type: "number" }}
constructor(protected router: Router, protected activatedRoute: ActivatedRoute ) {
super(router, activatedRoute);
}
private setZoomFactor(newZoomFactor: number){
if (newZoomFactor > 0){
this.zoomFactor = Math.round(newZoomFactor*100)/100;
} else {
this.zoomFactor = this.zoomFactor/2
}
this.updateParams();
}
}
Event Timeline
Log In to Comment