1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Merge navigation and panel modules in HA-JS

This commit is contained in:
Paulus Schoutsen
2016-07-31 14:19:27 -07:00
parent 882ebfedd1
commit 56650a25df
8 changed files with 23 additions and 35 deletions

View File

@@ -147,27 +147,20 @@
updateCards: function (columns, states, showIntroduction,
panelVisible, viewVisible) {
/* eslint-disable no-console */
if (!panelVisible || !viewVisible) {
console.log('cancelling update cards',
this.getAttribute('data-view') || 'default-view',
panelVisible, viewVisible);
return;
}
console.log('updateCards', this.getAttribute('data-view') || 'default-view',
panelVisible, viewVisible);
this.debounce(
'updateCards',
function () { this.cards = this.computeCards(columns, states,
showIntroduction); }
);
'updateCards', function () {
// Things might have changed since it got scheduled.
if (this.panelVisible && this.viewVisible) {
this.cards = this.computeCards(columns, states, showIntroduction);
}
}.bind(this));
},
computeCards: function (columns, states, showIntroduction) {
// Things might have changed since it got scheduled.
if (!this.panelVisible || !this.viewVisible) {
return;
}
console.error('computeCards', this.getAttribute('data-view') || 'default-view', states.size, this.viewVisible)
var hass = this.hass;
var byDomain = states.groupBy(function (entity) { return entity.domain; });
var hasGroup = {};

View File

@@ -175,7 +175,7 @@ Polymer({
selected: {
type: String,
bindNuclear: function (hass) {
return hass.navigationGetters.activePane;
return hass.navigationGetters.activePanelName;
},
},
@@ -197,7 +197,7 @@ Polymer({
type: Array,
bindNuclear: function (hass) {
return [
hass.panelGetters.panels,
hass.navigationGetters.panels,
function (res) { return res.toJS(); },
];
},