Simplify and fix cards

This commit is contained in:
Andras Schmelczer 2022-09-21 13:30:54 +02:00
parent f9540abdef
commit fcf7f64acd
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
3 changed files with 19 additions and 20 deletions

View file

@ -34,7 +34,6 @@ export class PageTimelineElement extends PageElement {
this.query('.info-button').addEventListener('click', this.toggleOpen.bind(this));
this.attachElementByReplacing('.figure', timelineElement.figure);
this.query('.description').innerText = timelineElement.description;
timelineElement.links.forEach((l) => this.attachElementAsChildOf('.buttons', l));
this.isOpen = false;
@ -53,17 +52,17 @@ export class PageTimelineElement extends PageElement {
}
private openMore() {
const deltaHeight = this.more!.scrollHeight;
this.more!.style.height = `${deltaHeight.toString()}px`;
const deltaHeight = this.more.scrollHeight;
this.more.style.height = `${deltaHeight.toString()}px`;
}
private closeMore() {
this.more!.style.height = '0';
this.more.style.height = '0';
}
private handleResize() {
if (this.isOpen) {
this.more!.style.height = 'auto';
this.more.style.height = 'auto';
this.openMore.bind(this);
}
}