Added font-awesome capabilities
Added a way to use font-awesome for the icons on the tabs. Requires font-awesome to be loaded in the HTML page that uses electron-tabs and the "iconURL" starting with "fa-".
This commit is contained in:
parent
43b1fb7ae0
commit
99a78390a3
1 changed files with 7 additions and 1 deletions
8
index.js
8
index.js
|
@ -160,7 +160,13 @@ class Tab extends EventEmitter {
|
|||
this.iconURL = iconURL;
|
||||
let span = this.tabElements.icon;
|
||||
if (iconURL) {
|
||||
span.innerHTML = `<img src="${iconURL}" />`;
|
||||
console.log(iconURL);
|
||||
if(iconURL.startsWith("fa-")) {
|
||||
span.innerHTML = `<i class="fa ${iconURL}"></i>`;
|
||||
}
|
||||
else {
|
||||
span.innerHTML = `<img src="${iconURL}" />`;
|
||||
}
|
||||
}
|
||||
this.emit("icon-changed", iconURL, this);
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue