mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 10:26:35 +00:00
Polymer2 fixes (#376)
* Set all attributes together. * Revert "Set all attributes together." This reverts commit 00fe75ce4b78c17481bac45db0536169695f1f91. * Set all attributes together. * Workaround for justified on Polymer2
This commit is contained in:
parent
ebc0c776e2
commit
f57e2334c8
@ -24,6 +24,10 @@
|
||||
@apply(--layout-horizontal);
|
||||
@apply(--layout-justified);
|
||||
}
|
||||
|
||||
dom-if {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<paper-card>
|
||||
<div class='card-content'>
|
||||
|
@ -93,6 +93,10 @@
|
||||
padding: 0 8px;
|
||||
opacity: var(--dark-secondary-opacity);
|
||||
}
|
||||
|
||||
dom-if {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<app-toolbar>
|
||||
|
@ -22,6 +22,10 @@
|
||||
ha-entity-toggle {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
dom-if {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class='horizontal justified layout'>
|
||||
|
@ -106,9 +106,15 @@ window.hassUtil.dynamicContentUpdater = function (root, newElementTag, attribute
|
||||
customEl = document.createElement(newElementTag);
|
||||
}
|
||||
|
||||
Object.keys(attributes).forEach(function (key) {
|
||||
customEl[key] = attributes[key];
|
||||
});
|
||||
if (customEl.setProperties) {
|
||||
customEl.setProperties(attributes);
|
||||
} else {
|
||||
// If custom element definition wasn't loaded yet - setProperties would be
|
||||
// missing, but no harm in setting attributes one-by-one then.
|
||||
Object.keys(attributes).forEach((key) => {
|
||||
customEl[key] = attributes[key];
|
||||
});
|
||||
}
|
||||
|
||||
if (customEl.parentNode === null) {
|
||||
rootEl.appendChild(customEl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user