mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Fix miniy fail (#1674)
This commit is contained in:
parent
7e0ff14f28
commit
15d21cc673
@ -7,9 +7,10 @@ class HuiErrorCard extends PolymerElement {
|
|||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: red;
|
background-color: #ef5350;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
[[_config.error]]
|
[[_config.error]]
|
||||||
|
@ -61,11 +61,6 @@ function _createErrorElement(error, config) {
|
|||||||
return _createElement('hui-error-card', createErrorCardConfig(error, config));
|
return _createElement('hui-error-card', createErrorCardConfig(error, config));
|
||||||
}
|
}
|
||||||
|
|
||||||
function _hideErrorElement(element) {
|
|
||||||
element.style.display = 'None';
|
|
||||||
return window.setTimeout(() => { element.style.display = ''; }, TIMEOUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function createCardElement(config) {
|
export default function createCardElement(config) {
|
||||||
if (!config || typeof config !== 'object' || !config.type) {
|
if (!config || typeof config !== 'object' || !config.type) {
|
||||||
return _createErrorElement('No card type configured.', config);
|
return _createErrorElement('No card type configured.', config);
|
||||||
@ -78,7 +73,8 @@ export default function createCardElement(config) {
|
|||||||
return _createElement(tag, config);
|
return _createElement(tag, config);
|
||||||
}
|
}
|
||||||
const element = _createErrorElement(`Custom element doesn't exist: ${tag}.`, config);
|
const element = _createErrorElement(`Custom element doesn't exist: ${tag}.`, config);
|
||||||
const timer = _hideErrorElement(element);
|
element.style.display = 'None';
|
||||||
|
const timer = window.setTimeout(() => { element.style.display = ''; }, TIMEOUT);
|
||||||
|
|
||||||
customElements.whenDefined(tag).then(() => {
|
customElements.whenDefined(tag).then(() => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user