Refactor portfolio and fix grammar

This commit is contained in:
schmelczerandras 2020-11-26 17:15:57 +01:00
parent 86ddc3d0d8
commit 59a0afbac7
37 changed files with 546 additions and 451 deletions

View file

@ -1,8 +1,19 @@
import { TimelineElement } from '../../../types/portfolio';
import { PageContent } from '../../content/content';
import { PageElement } from '../../page-element';
import { generate } from './timeline-element.html';
import { createElement } from '../../../helper/create-element';
import { Video } from '../../basics/video/video';
import { Image } from '../../basics/image/image';
import { Preview } from '../../basics/preview/preview';
export interface TimelineElementParameters {
date: string;
figure: Image | Video | Preview;
title: string;
description: string;
more?: Array<string>;
links: Array<PageElement>;
}
export class PageTimelineElement extends PageElement {
private isOpen: boolean;
@ -11,7 +22,7 @@ export class PageTimelineElement extends PageElement {
private showLess: string;
public constructor(
timelineElement: TimelineElement,
timelineElement: TimelineElementParameters,
showMore: string,
showLess: string
) {
@ -30,7 +41,7 @@ export class PageTimelineElement extends PageElement {
} else super(root);
this.attachElementByReplacing('.figure', timelineElement.figure);
this.attachElementByReplacing('.description', timelineElement.description);
this.query('.description').innerText = timelineElement.description;
timelineElement.links.forEach(l => this.attachElementAsChildOf('.buttons', l));
this.showMore = showMore;