New attempts to minimize the problems in #17
This commit is contained in:
parent
d4acb7de58
commit
4d3408560d
@ -16,6 +16,7 @@ class LayoutCard extends cardTools.LitElement {
|
||||
window.addEventListener('resize', () => this.build());
|
||||
window.addEventListener('hass-open-menu', () => setTimeout(() => this.build(), 100));
|
||||
window.addEventListener('hass-close-menu', () => setTimeout(() => this.build(), 100));
|
||||
window.addEventListener('location-changed', () => setTimeout(() => this.build(), 100));
|
||||
if(config.rebuild)
|
||||
window.setTimeout(() => this.build(), config.rebuild);
|
||||
}
|
||||
@ -88,6 +89,7 @@ class LayoutCard extends cardTools.LitElement {
|
||||
}
|
||||
|
||||
build() {
|
||||
if (this.offsetParent === null) return;
|
||||
const root = this.shadowRoot.querySelector("#columns");
|
||||
while(root.lastChild) {
|
||||
root.removeChild(root.lastChild);
|
||||
|
Loading…
x
Reference in New Issue
Block a user