Skip to content

Commit

Permalink
Play nice with other icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Nov 23, 2021
1 parent 8d2c140 commit cb7b171
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/fontawesome/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion custom_components/fontawesome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"codeowners": [],
"requirements": [],
"config_flow": true,
"version": "2.1.4",
"version": "2.1.5",
"iot_class": "local_polling"
}
8 changes: 5 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ customElements.whenDefined("ha-svg-icon").then(() => {
while (svgGroup && svgGroup.children.length > 1)
svgGroup.removeChild(svgGroup.lastChild);

while (this.shadowRoot.querySelector("style")) {
const el = this.shadowRoot.querySelector("style");
while (this.shadowRoot.querySelector("style.fontawesome")) {
const el = this.shadowRoot.querySelector("style.fontawesome");
el.parentNode.removeChild(el);
}
};
Expand All @@ -159,7 +159,9 @@ customElements.whenDefined("ha-svg-icon").then(() => {
await this.updateComplete;
if (paths == undefined || Object.keys(paths).length === 0) return;
const styleEl =
this.shadowRoot.querySelector("style") || document.createElement("style");
this.shadowRoot.querySelector("style.fontawesome") ||
document.createElement("style");
styleEl.classList.add("fontawesome");
styleEl.innerHTML = `
.secondary {
opacity: 0.4;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fontawesome",
"private": true,
"version": "2.1.4",
"version": "2.1.5",
"description": "",
"scripts": {
"export": "./export.sh",
Expand Down
2 changes: 2 additions & 0 deletions test/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
default_config:

demo:

hacs:

0 comments on commit cb7b171

Please sign in to comment.