Skip to content

Commit

Permalink
refactor(): refactor the creation of the icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGysemans committed Apr 15, 2021
1 parent cd76eae commit 1bafe0b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/JSPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,10 @@ class JSPanel {
const li = this._createEl("li");

if ((item.icon && !item.fontawesome_icon) || (item.icon && item.fontawesome_icon)) {
const icon = this._createEl("img");
icon.setAttribute("src", item.icon);
const icon = this._createEl("img", { attributes: [["src", item.icon]] });
li.appendChild(icon);
} else if (!item.icon && item.fontawesome_icon) {
const icon = this._createEl("i");
const classes = item.fontawesome_icon.split(" ");
for (let clas of classes) icon.classList.add(clas);
const icon = this._createEl("i", { className: item.fontawesome_icon });
li.appendChild(icon);
}

Expand Down

0 comments on commit 1bafe0b

Please sign in to comment.