Will it work?
This commit is contained in:
parent
79f7c4c16f
commit
f74c86f4b1
19 changed files with 193 additions and 78 deletions
|
|
@ -4,15 +4,22 @@ import { PageEventType } from "./page-event";
|
|||
export class Page extends PageElement {
|
||||
public constructor(
|
||||
children: Array<PageElement>,
|
||||
private rootElement: HTMLElement
|
||||
private rootElement: HTMLElement,
|
||||
isRootPage = false
|
||||
) {
|
||||
super(children);
|
||||
this.setElement(rootElement);
|
||||
this.broadcastEvent(
|
||||
{ type: PageEventType.eventBroadcasterChanged, data: this },
|
||||
this
|
||||
);
|
||||
if (isRootPage) {
|
||||
this.broadcastEvent(
|
||||
{ type: PageEventType.eventBroadcasterChanged, data: this },
|
||||
this
|
||||
);
|
||||
}
|
||||
|
||||
rootElement.append(...children.map(e => e.getElement()).filter(e => e));
|
||||
this.broadcastEvent({ type: PageEventType.onLoad }, this);
|
||||
|
||||
if (isRootPage) {
|
||||
this.broadcastEvent({ type: PageEventType.onLoad }, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue