mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Don't render cards when pane not visible
This commit is contained in:
parent
ad8a3cb59d
commit
59d347672f
@ -128,20 +128,27 @@
|
|||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
paneVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
|
||||||
cards: {
|
cards: {
|
||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
observers: [
|
observers: [
|
||||||
'updateCards(columns, states, showIntroduction)',
|
'updateCards(columns, states, showIntroduction, paneVisible)',
|
||||||
],
|
],
|
||||||
|
|
||||||
updateCards: function (columns, states, showIntroduction) {
|
updateCards: function (columns, states, showIntroduction, paneVisible) {
|
||||||
|
if (!paneVisible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.debounce(
|
this.debounce(
|
||||||
'updateCards',
|
'updateCards',
|
||||||
function () { this.cards = this.computeCards(columns, states, showIntroduction); },
|
function () { this.cards = this.computeCards(columns, states,
|
||||||
0
|
showIntroduction); }
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
attr-for-selected='id'
|
attr-for-selected='id'
|
||||||
fallback-selection='panel-resolver'
|
fallback-selection='panel-resolver'
|
||||||
selected='[[activePane]]'
|
selected='[[activePane]]'
|
||||||
|
selected-attribute='pane-visible'
|
||||||
>
|
>
|
||||||
<partial-cards
|
<partial-cards
|
||||||
id='states'
|
id='states'
|
||||||
|
@ -54,7 +54,10 @@
|
|||||||
|
|
||||||
<ha-cards
|
<ha-cards
|
||||||
show-introduction='[[computeShowIntroduction(currentView, introductionLoaded, states)]]'
|
show-introduction='[[computeShowIntroduction(currentView, introductionLoaded, states)]]'
|
||||||
states='[[states]]' columns='[[columns]]' hass='[[hass]]'
|
states='[[states]]'
|
||||||
|
columns='[[columns]]'
|
||||||
|
hass='[[hass]]'
|
||||||
|
pane-visible='[[paneVisible]]'
|
||||||
></ha-cards>
|
></ha-cards>
|
||||||
</app-header-layout>
|
</app-header-layout>
|
||||||
</template>
|
</template>
|
||||||
@ -77,6 +80,11 @@ Polymer({
|
|||||||
value: false,
|
value: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
paneVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
|
||||||
isFetching: {
|
isFetching: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
bindNuclear: function (hass) {
|
bindNuclear: function (hass) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user