mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-22 19:43:53 +00:00
Merge pull request #31 from kontrollanten/master
Prevent undefined/false value to be set in badges
This commit is contained in:
commit
0cf0ba99dd
8
index.js
8
index.js
|
@ -161,13 +161,13 @@ class Tab extends EventEmitter {
|
|||
setBadge (badge) {
|
||||
if (this.isClosed) return;
|
||||
let span = this.tabElements.badge;
|
||||
span.innerHTML = badge;
|
||||
this.badge = badge;
|
||||
|
||||
if (!badge) {
|
||||
span.classList.add('hidden');
|
||||
} else {
|
||||
if (badge) {
|
||||
span.innerHTML = badge;
|
||||
span.classList.remove('hidden');
|
||||
} else {
|
||||
span.classList.add('hidden');
|
||||
}
|
||||
|
||||
this.emit("badge-changed", badge, this);
|
||||
|
|
Loading…
Reference in a new issue