Merge pull request #31 from kontrollanten/master

Prevent undefined/false value to be set in badges
This commit is contained in:
Thomas Brouard 2017-07-02 12:59:36 +02:00 committed by GitHub
commit 0cf0ba99dd

View file

@ -161,13 +161,13 @@ class Tab extends EventEmitter {
setBadge (badge) { setBadge (badge) {
if (this.isClosed) return; if (this.isClosed) return;
let span = this.tabElements.badge; let span = this.tabElements.badge;
span.innerHTML = badge;
this.badge = badge; this.badge = badge;
if (!badge) { if (badge) {
span.classList.add('hidden'); span.innerHTML = badge;
} else {
span.classList.remove('hidden'); span.classList.remove('hidden');
} else {
span.classList.add('hidden');
} }
this.emit("badge-changed", badge, this); this.emit("badge-changed", badge, this);