mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
46063: css attempt to fix multiline clamping
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import {
|
||||
ChangeDetectorRef, Component, ElementRef, Inject, Input,
|
||||
OnInit
|
||||
} from '@angular/core';
|
||||
import { NativeWindowRef, NativeWindowService } from '../window.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-truncatable',
|
||||
templateUrl: './truncatable.component.html'
|
||||
})
|
||||
export class TruncatableComponent implements OnInit {
|
||||
|
||||
@Input() lines: number;
|
||||
@Input() innerHTML;
|
||||
height;
|
||||
styles: any;
|
||||
|
||||
public constructor(private elementRef: ElementRef, @Inject(NativeWindowService) private _window: NativeWindowRef, private changeDetectorRef: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.styles = this._window.nativeWindow.getComputedStyle(this.elementRef.nativeElement);
|
||||
setTimeout(() => {
|
||||
this.height = this.styles.lineHeight.replace('px', '') * this.lines;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}, 0);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user