Delay removing of init skeleton.

This commit is contained in:
Paulus Schoutsen 2015-12-17 19:41:26 -08:00
parent f3d3724df7
commit 190911b261
4 changed files with 14 additions and 6 deletions

View File

@ -68,12 +68,6 @@ export default new Polymer({
this.registerServiceWorker();
},
attached() {
// remove the HTML init message
const initMsg = document.getElementById('init');
initMsg.parentElement.removeChild(initMsg);
},
ready() {
reactor.batch(() => {
// if auth was given, tell the backend

View File

@ -2,6 +2,7 @@ import Polymer from '../polymer';
import hass from '../util/home-assistant-js-instance';
import nuclearObserver from '../util/bound-nuclear-behavior';
import removeInitMsg from '../util/remove-init-message';
require('../components/ha-sidebar');
require('../layouts/partial-zone');
@ -113,6 +114,7 @@ export default new Polymer({
},
attached() {
removeInitMsg();
startUrlSync();
},

View File

@ -4,6 +4,7 @@ import hass from '../util/home-assistant-js-instance';
import nuclearObserver from '../util/bound-nuclear-behavior';
import validateAuth from '../util/validate-auth';
import removeInitMsg from '../util/remove-init-message';
const { authGetters } = hass;
@ -54,6 +55,10 @@ export default new Polymer({
'validatingChanged(isValidating, isInvalid)',
],
attached() {
removeInitMsg();
},
computeShowSpinner(forceShowLoading, isValidating) {
return forceShowLoading || isValidating;
},

View File

@ -0,0 +1,7 @@
export default function removeInitMessage() {
// remove the HTML init message
const initMsg = document.getElementById('ha-init-skeleton');
if (initMsg) {
initMsg.parentElement.removeChild(initMsg);
}
}