mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
use custom elements for application layout
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { target } from "@github/catalyst";
|
||||
|
||||
class BaseLayoutElement extends HTMLElement {
|
||||
@target slotted: HTMLElement;
|
||||
@target appSlot: HTMLElement;
|
||||
public isLayout: boolean = true;
|
||||
public _slotted: string;
|
||||
public _appSlot: string;
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
get slotTag() {
|
||||
return this.slotted?.firstElementChild?.tagName;
|
||||
return this.appSlot?.firstElementChild?.tagName;
|
||||
}
|
||||
|
||||
compareTags = (tag: string | HTMLElement): boolean => {
|
||||
@@ -20,9 +20,9 @@ class BaseLayoutElement extends HTMLElement {
|
||||
};
|
||||
|
||||
setElement = (newTag: string) => {
|
||||
const _slotted = `<${newTag}></${newTag}>`;
|
||||
this._slotted = _slotted;
|
||||
this.slotted.innerHTML = _slotted;
|
||||
const _appSlot = `<${newTag}></${newTag}>`;
|
||||
this._appSlot = _appSlot;
|
||||
this.appSlot.innerHTML = _appSlot;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user