Extract loading screen from partial-panel-resolver

This commit is contained in:
Paulus Schoutsen 2017-05-11 22:23:03 -07:00
parent 3f68619e3a
commit 0754c007f2
2 changed files with 17 additions and 36 deletions

View File

@ -4,7 +4,7 @@
<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">
<dom-module id='hassio-loading'>
<dom-module id='hass-loading-screen'>
<template>
<style include='iron-flex ha-style'>
[hidden] {
@ -23,7 +23,7 @@
<div class='placeholder'>
<app-toolbar>
<ha-menu-button narrow='[[narrow]]' show-menu='[[showMenu]]'></ha-menu-button>
<div main-title>Hass.io</div>
<div main-title>[[title]]</div>
</app-toolbar>
<div class='layout horizontal center-center'>
<paper-spinner active></paper-spinner>
@ -34,13 +34,9 @@
<script>
Polymer({
is: 'hassio-loading',
is: 'hass-loading-screen',
properties: {
hass: {
type: Object,
},
narrow: {
type: Boolean,
value: false,
@ -50,6 +46,11 @@ Polymer({
type: Boolean,
value: false,
},
title: {
type: String,
value: '',
},
},
});
</script>

View File

@ -1,41 +1,21 @@
<link rel='import' href='../../bower_components/paper-spinner/paper-spinner.html'>
<link rel='import' href='../../bower_components/polymer/polymer.html'>
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">
<link rel='import' href='../components/ha-menu-button.html'>
<link rel="import" href="../resources/ha-style.html">
<link rel="import" href="./hass-loading-screen.html">
<dom-module id='partial-panel-resolver'>
<template>
<style include='iron-flex ha-style'>
<style>
[hidden] {
display: none !important;
}
.placeholder {
height: 100%;
}
.layout {
height: calc(100% - 64px);
}
</style>
<div hidden$='[[resolved]]' class='placeholder'>
<app-toolbar>
<ha-menu-button narrow='[[narrow]]' show-menu='[[showMenu]]'></ha-menu-button>
</app-toolbar>
<div class='layout horizontal center-center'>
<template is='dom-if' if='[[!errorLoading]]'>
<paper-spinner active></paper-spinner>
<template is='dom-if' if='[[!resolved]]'>
<hass-loading-screen
narrow='[[narrow]]'
show-menu='[[showMenu]]'
></hass-loading-screen>
</template>
<template is='dom-if' if='[[errorLoading]]'>
Error loading panel :(
</template>
</div>
</div>
<span id='panel' hidden$='[[!resolved]]'></span>
</template>