mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 15:56:35 +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>
|
</style>
|
||||||
|
|
||||||
<div class='main'>
|
<div id='main'>
|
||||||
<template is='dom-if' if='[[cards.badges]]'>
|
<template is='dom-if' if='[[cards.badges]]'>
|
||||||
<div class='badges'>
|
<div class='badges'>
|
||||||
<template is='dom-if' if='[[cards.demo]]'>
|
<template is='dom-if' if='[[cards.demo]]'>
|
||||||
@ -184,7 +184,13 @@
|
|||||||
orderedGroups
|
orderedGroups
|
||||||
) {
|
) {
|
||||||
if (!panelVisible || !viewVisible) {
|
if (!panelVisible || !viewVisible) {
|
||||||
|
if (this.$.main.parentNode) {
|
||||||
|
this.$.main._parentNode = this.$.main.parentNode;
|
||||||
|
this.$.main.parentNode.removeChild(this.$.main);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
} else if (!this.$.main.parentNode && this.$.main._parentNode) {
|
||||||
|
this.$.main._parentNode.appendChild(this.$.main);
|
||||||
}
|
}
|
||||||
this._debouncer = Polymer.Debouncer.debounce(
|
this._debouncer = Polymer.Debouncer.debounce(
|
||||||
this._debouncer,
|
this._debouncer,
|
||||||
@ -198,14 +204,19 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
computeCards(columns, states, orderedGroups) {
|
emptyCards() {
|
||||||
const hass = this.hass;
|
return {
|
||||||
|
|
||||||
const cards = {
|
|
||||||
demo: false,
|
demo: false,
|
||||||
badges: [],
|
badges: [],
|
||||||
columns: [],
|
columns: [],
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
computeCards(columns, states, orderedGroups) {
|
||||||
|
const hass = this.hass;
|
||||||
|
|
||||||
|
const cards = this.emptyCards();
|
||||||
|
|
||||||
const entityCount = [];
|
const entityCount = [];
|
||||||
for (let i = 0; i < columns; i++) {
|
for (let i = 0; i < columns; i++) {
|
||||||
cards.columns.push([]);
|
cards.columns.push([]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user