Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F86225094
page-view-wrapper.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, Oct 5, 01:48
Size
1 KB
Mime Type
text/x-java
Expires
Mon, Oct 7, 01:48 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
21377116
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
page-view-wrapper.component.ts
View Options
import {AfterViewInit, Component, HostListener, Input, OnInit} from '@angular/core';
import {ActivatedRoute, Params} from '@angular/router';
@Component({
selector: 'app-page-view-wrapper-component',
templateUrl: './page-view-wrapper.component.html',
styleUrls: ['./page-view-wrapper.component.scss']
})
export class PageViewWrapperComponent implements OnInit, AfterViewInit {
@Input() showAllLines: boolean = false;
fullscreen: boolean;
innerHeight: number;
constructor(private activatedRoute: ActivatedRoute) { }
ngOnInit() {
this.innerHeight = window.innerHeight;
this.activatedRoute.queryParams.subscribe( (queryParams: Params) => this.fullscreen = (queryParams.fullscreen === 'true') );
}
@HostListener('window:resize', ['$event'])
onResize(event) {
this.ngOnInit();
}
ngAfterViewInit() {
window.setTimeout(() => this.logHeights(), 500);
}
logHeights() {
console.log('Window inner height', window.innerHeight);
console.log('Window outer height', window.outerHeight);
const elemIds = ['wrapper', 'navigator', 'content', 'tooltip-container', 'page'];
elemIds.forEach(id => {
const el = document.getElementById(id);
if (el) {
console.log('--------------------');
console.log(id);
console.log(el);
// including the element's border
const height = el.offsetHeight;
// not including the element's border
const cHeight = el.clientHeight;
console.log('height with border: ', height);
console.log('height without border: ', cHeight);
}
});
}
}
Event Timeline
Log In to Comment