Skip to content
Snippets Groups Projects
Commit eb6008f9 authored by rhenck's avatar rhenck
Browse files

Fix page constructor parameter

Page needs to be a partial as it is only the blueprint.
parent 7f1640ec
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ export class Page {
alwaysVisiblePagePosition: 'left' | 'right' | 'top' | 'bottom' = 'left';
alwaysVisibleAspectRatio: number = 50;
constructor(page?: Page, idManager?: IDManager) {
constructor(page?: Partial<Page>, idManager?: IDManager) {
if (page?.hasMaxWidth) this.hasMaxWidth = page.hasMaxWidth;
if (page?.maxWidth) this.maxWidth = page.maxWidth;
if (page?.margin) this.margin = page.margin;
......@@ -21,7 +21,7 @@ export class Page {
if (page?.alwaysVisible) this.alwaysVisible = page.alwaysVisible;
if (page?.alwaysVisiblePagePosition) this.alwaysVisiblePagePosition = page.alwaysVisiblePagePosition;
if (page?.alwaysVisibleAspectRatio) this.alwaysVisibleAspectRatio = page.alwaysVisibleAspectRatio;
this.sections = page?.sections.map(section => new Section(section, idManager)) || [new Section()];
this.sections = page?.sections?.map(section => new Section(section, idManager)) || [new Section()];
}
getAllElements(elementType?: string): UIElement[] {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment