Mostly done

This commit is contained in:
Schmelczer András 2019-12-29 15:30:41 +01:00
parent 632a7703ff
commit 10015a4ebe
23 changed files with 258 additions and 158 deletions

View file

@ -20,7 +20,7 @@ export class PageTimelineElement extends PageElement {
const content = new PageContent(timelineElement.more);
super([content]);
this.isOpen = false;
this.more = root.querySelector("#more");
this.more = root.querySelector(".more");
this.more.appendChild(content.getElement());
window.addEventListener("resize", this.handleResize.bind(this));
root
@ -31,8 +31,8 @@ export class PageTimelineElement extends PageElement {
}
private toggleOpen() {
const showMore = this.query("#show-more") as HTMLElement;
const showLess = this.query("#show-less") as HTMLElement;
const showMore = this.query(".show-more") as HTMLElement;
const showLess = this.query(".show-less") as HTMLElement;
if (this.isOpen) {
PageTimelineElement.show(showMore);
PageTimelineElement.hide(showLess);
@ -51,6 +51,14 @@ export class PageTimelineElement extends PageElement {
type: PageEventType.onBodyDimensionsChanged,
data: { deltaHeight }
});
setTimeout(
() =>
this.eventBroadcaster?.broadcastEvent({
type: PageEventType.onBodyDimensionsChanged
}),
350
);
}
private static hide(element: HTMLElement) {