use custom elements for application layout

This commit is contained in:
Fran Jurmanović
2021-05-31 14:23:13 +02:00
parent e1ab0e51d6
commit e065efc499
9 changed files with 110 additions and 15 deletions

View File

@@ -35,6 +35,15 @@ class HomePageElement extends HTMLElement {
return html`<div>${until(this.getPong())}</div>`;
};
openModal = () => {
const _modal = this.appMain.appModal;
if (_modal) {
this.appMain.closeModal();
} else {
this.appMain.createModal("login-page");
}
};
render() {
return html`
<app-link data-to="/" data-title="Main"></app-link> |
@@ -48,6 +57,7 @@ class HomePageElement extends HTMLElement {
data-to="/login"
data-title="Login"
></app-link>`}
<button data-action="click:home-page#openModal">Test</button>
`;
}