Better way to provide hass to popups, fix thomasloven/lovelace-popup-card#14

This commit is contained in:
Thomas Lovén 2019-03-07 13:05:34 +01:00
parent 5fbed48b80
commit ae9a3dcd7a

View File

@ -369,14 +369,13 @@ class {
moreInfo._page = "none"; moreInfo._page = "none";
moreInfo.shadowRoot.appendChild(popup); moreInfo.shadowRoot.appendChild(popup);
moreInfo.large = large; moreInfo.large = large;
document.querySelector("home-assistant").provideHass(message);
setTimeout(() => { setTimeout(() => {
let interval = setInterval(() => { let interval = setInterval(() => {
if (moreInfo.getAttribute('aria-hidden')) { if (moreInfo.getAttribute('aria-hidden')) {
popup.parentNode.removeChild(popup); popup.parentNode.removeChild(popup);
clearInterval(interval); clearInterval(interval);
} else {
message.hass = this.hass;
} }
}, 100) }, 100)
}, 1000); }, 1000);