Merge branch 'dev'

* dev:
  Hide history view when history component not loaded
pull/30/head
Paulus Schoutsen 2015-02-07 22:17:35 -08:00
commit 1d5a3b73f9
3 changed files with 26 additions and 9 deletions

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "db6b9c263c4be99af5b25b8c1cb20e57"
VERSION = "b45d1c9687dea7c746e8366c65d39d0e"

View File

@ -201,10 +201,10 @@ return pickBy("isBefore",args)};moment.max=function(){var args=[].slice.call(arg
States
</paper-item><paper-item data-panel="group"><core-icon icon="homeassistant-24:group"></core-icon>
Groups
</paper-item><paper-item data-panel="history"><core-icon icon="assessment"></core-icon>
History
</paper-item><div flex=""></div><paper-item id="logout" on-click="{{handleLogOutClick}}"><core-icon icon="exit-to-app"></core-icon>
</paper-item><template if="{{hasHistoryComponent}}"><paper-item data-panel="history"><core-icon icon="assessment"></core-icon>
History
</paper-item></template><div flex=""></div><paper-item id="logout" on-click="{{handleLogOutClick}}"><core-icon icon="exit-to-app"></core-icon>
Log Out
</paper-item><div class="seperator">Developer Tools</div><div class="dev-tools" layout="" horizontal="" justified=""><paper-icon-button icon="settings-remote" data-panel="call-service" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-ethernet" data-panel="set-state" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-input-antenna" data-panel="fire-event" on-click="{{handleDevClick}}"></paper-icon-button></div></core-menu></core-header-panel><partial-states hidden?="{{selected != 'states' && selected != 'group'}}" main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}" filter="{{selected == 'group' ? 'group' : null}}"></partial-states><template if="{{selected == 'history'}}"><partial-history main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-history></template><template if="{{selected == 'fire-event'}}"><partial-dev-fire-event main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-fire-event></template><template if="{{selected == 'set-state'}}"><partial-dev-set-state main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-set-state></template><template if="{{selected == 'call-service'}}"><partial-dev-call-service main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-call-service></template></core-drawer-panel></template><script>Polymer("home-assistant-main",{selected:"states",narrow:false,ready:function(){this.togglePanel=this.togglePanel.bind(this)},menuSelect:function(ev,detail,sender){if(detail.isSelected){this.selectPanel(detail.item)}},handleDevClick:function(ev,detail,sender){this.$.menu.selected=-1;this.selectPanel(ev.target)},selectPanel:function(element){var newChoice=element.dataset.panel;if(newChoice!==this.selected){this.togglePanel();this.selected=newChoice}},responsiveChanged:function(ev,detail,sender){this.narrow=detail.narrow},togglePanel:function(){this.$.drawer.togglePanel()},handleLogOutClick:function(){window.hass.authActions.logOut()}});</script></polymer-element></div>
</paper-item><div class="seperator">Developer Tools</div><div class="dev-tools" layout="" horizontal="" justified=""><paper-icon-button icon="settings-remote" data-panel="call-service" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-ethernet" data-panel="set-state" on-click="{{handleDevClick}}"></paper-icon-button><paper-icon-button icon="settings-input-antenna" data-panel="fire-event" on-click="{{handleDevClick}}"></paper-icon-button></div></core-menu></core-header-panel><partial-states hidden?="{{selected != 'states' && selected != 'group'}}" main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}" filter="{{selected == 'group' ? 'group' : null}}"></partial-states><template if="{{selected == 'history'}}"><partial-history main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-history></template><template if="{{selected == 'fire-event'}}"><partial-dev-fire-event main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-fire-event></template><template if="{{selected == 'set-state'}}"><partial-dev-set-state main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-set-state></template><template if="{{selected == 'call-service'}}"><partial-dev-call-service main="" narrow="{{narrow}}" togglepanel="{{togglePanel}}"></partial-dev-call-service></template></core-drawer-panel></template><script>Polymer("home-assistant-main",{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){if(detail.isSelected){this.selectPanel(detail.item)}},handleDevClick:function(ev,detail,sender){this.$.menu.selected=-1;this.selectPanel(ev.target)},selectPanel:function(element){var newChoice=element.dataset.panel;if(newChoice!==this.selected){this.togglePanel();this.selected=newChoice}},responsiveChanged:function(ev,detail,sender){this.narrow=detail.narrow},togglePanel:function(){this.$.drawer.togglePanel()},handleLogOutClick:function(){window.hass.authActions.logOut()}});</script></polymer-element></div>
<polymer-element name="home-assistant" attributes="auth" assetpath="polymer/"><template><style>:host{font-family:RobotoDraft,'Helvetica Neue',Helvetica,Arial;font-weight:300}</style><home-assistant-api auth="{{auth}}"></home-assistant-api><template if="{{!loaded}}"><login-form></login-form></template><template if="{{loaded}}"><home-assistant-main></home-assistant-main></template></template><script>Polymer("home-assistant",{loaded:window.hass.syncStore.initialLoadDone(),ready:function(){document.getElementById("init").remove();window.hass.syncStore.addChangeListener(this.updateLoadStatus.bind(this))},updateLoadStatus:function(){this.loaded=window.hass.syncStore.initialLoadDone()}});</script></polymer-element>

View File

@ -75,10 +75,13 @@
<core-icon icon="homeassistant-24:group"></core-icon>
Groups
</paper-item>
<paper-item data-panel="history">
<core-icon icon="assessment"></core-icon>
History
</paper-item>
<template if="{{hasHistoryComponent}}">
<paper-item data-panel="history">
<core-icon icon="assessment"></core-icon>
History
</paper-item>
</template>
<div flex></div>
@ -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) {