Refactor and minor fixes
This commit is contained in:
parent
2dc9c45642
commit
fe75f9af88
31 changed files with 187 additions and 193 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import { html } from '../../../types/html';
|
||||
import { Image } from '../../basics/image/image';
|
||||
import { Preview } from '../../basics/preview/preview';
|
||||
import { Video } from '../../basics/video/video';
|
||||
|
||||
export interface TimelineElementParameters {
|
||||
date: string;
|
||||
figure: Image | Video | Preview;
|
||||
figure: html | Video | Preview;
|
||||
title: string;
|
||||
description: string;
|
||||
more: Array<string>;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const generate = (
|
|||
more
|
||||
? `
|
||||
<div class="more">
|
||||
${more.map((t) => `<p>${t}</p>`).join('\n')}
|
||||
${more.map((t) => `<p>${t}</p>`).join('')}
|
||||
</div>`
|
||||
: ''
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@
|
|||
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: -10px;
|
||||
|
||||
> a {
|
||||
@include sub-title-font();
|
||||
|
|
@ -131,7 +132,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
.description,
|
||||
.info-button {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ export class PageTimelineElement extends PageElement {
|
|||
addEventListener('resize', this.handleResize.bind(this));
|
||||
|
||||
this.query('.info-button').addEventListener('click', this.toggleOpen.bind(this));
|
||||
this.attachElementByReplacing('.figure', timelineElement.figure);
|
||||
this.attachElementByReplacing(
|
||||
'.figure',
|
||||
timelineElement.figure instanceof PageElement
|
||||
? timelineElement.figure
|
||||
: new PageElement(createElement(timelineElement.figure))
|
||||
);
|
||||
this.isOpen = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue