From 8c20e5137eb4956f7db942e7d545c2567db03055 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 7 Feb 2015 22:16:19 -0800 Subject: [PATCH] Hide history view when history component not loaded --- homeassistant/components/frontend/version.py | 2 +- .../frontend/www_static/frontend.html | 8 +++--- .../polymer/layouts/home-assistant-main.html | 25 ++++++++++++++++--- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 37ae80e9bc9..e8794b8bcb6 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "db6b9c263c4be99af5b25b8c1cb20e57" +VERSION = "b45d1c9687dea7c746e8366c65d39d0e" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 7d090f8d650..ee91975fdb3 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -201,10 +201,10 @@ return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arg States Groups - - History -
+
Log Out -
Developer Tools
+
Developer Tools
diff --git a/homeassistant/components/frontend/www_static/polymer/layouts/home-assistant-main.html b/homeassistant/components/frontend/www_static/polymer/layouts/home-assistant-main.html index 67b09055582..556ae8258cd 100644 --- a/homeassistant/components/frontend/www_static/polymer/layouts/home-assistant-main.html +++ b/homeassistant/components/frontend/www_static/polymer/layouts/home-assistant-main.html @@ -75,10 +75,13 @@ Groups - - - History - + +
@@ -131,9 +134,23 @@ Polymer({ selected: "states", narrow: false, + hasHistoryComponent: false, ready: function() { this.togglePanel = this.togglePanel.bind(this); + this.componentStoreChanged = this.componentStoreChanged.bind(this); + + window.hass.componentStore.addChangeListener(this.componentStoreChanged); + + this.componentStoreChanged(); + }, + + detached: function() { + window.hass.componentStore.removeChangeListener(this.componentStoreChanged); + }, + + componentStoreChanged: function() { + this.hasHistoryComponent = window.hass.componentStore.isLoaded('history'); }, menuSelect: function(ev, detail, sender) {