mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +00:00
Disconnect dom in invisible tabs (#790)
* Clear dom in invisible tabs * Disconnect DOM of inactive tabs
This commit is contained in:
parent
aced689207
commit
31d2b6ffe1
@ -51,7 +51,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class='main'>
|
||||
<div id='main'>
|
||||
<template is='dom-if' if='[[cards.badges]]'>
|
||||
<div class='badges'>
|
||||
<template is='dom-if' if='[[cards.demo]]'>
|
||||
@ -184,7 +184,13 @@
|
||||
orderedGroups
|
||||
) {
|
||||
if (!panelVisible || !viewVisible) {
|
||||
if (this.$.main.parentNode) {
|
||||
this.$.main._parentNode = this.$.main.parentNode;
|
||||
this.$.main.parentNode.removeChild(this.$.main);
|
||||
}
|
||||
return;
|
||||
} else if (!this.$.main.parentNode && this.$.main._parentNode) {
|
||||
this.$.main._parentNode.appendChild(this.$.main);
|
||||
}
|
||||
this._debouncer = Polymer.Debouncer.debounce(
|
||||
this._debouncer,
|
||||
@ -198,14 +204,19 @@
|
||||
);
|
||||
}
|
||||
|
||||
computeCards(columns, states, orderedGroups) {
|
||||
const hass = this.hass;
|
||||
|
||||
const cards = {
|
||||
emptyCards() {
|
||||
return {
|
||||
demo: false,
|
||||
badges: [],
|
||||
columns: [],
|
||||
};
|
||||
}
|
||||
|
||||
computeCards(columns, states, orderedGroups) {
|
||||
const hass = this.hass;
|
||||
|
||||
const cards = this.emptyCards();
|
||||
|
||||
const entityCount = [];
|
||||
for (let i = 0; i < columns; i++) {
|
||||
cards.columns.push([]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user