Skip to content

Commit

Permalink
Only show user count when greater than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nunof07 committed Sep 9, 2015
1 parent 452c8f3 commit 5cdea1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/javascripts/discourse/components/mumble-icon.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default Ember.Component.extend({
return Mumble.countUsers(this.get('rootChannel'), true);
}.property('rootChannel'),

showCount: function () {
return (this.get('userCount') > 0);
}.property('userCount'),

_refreshService: function () {
var _this = this,
interval = Discourse.SiteSettings.mumble_interval > 0 ? Discourse.SiteSettings.mumble_interval : 60000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
toggleVisible=dropdownVisible
loginAction="showLogin"
title="mumble.icon_title"}}
<span class='badge-notification mumble-user-count'>{{userCount}}</span>
{{#if showCount}}
<span class='badge-notification mumble-user-count'>{{userCount}}</span>
{{/if}}
{{#menu-panel visible=dropdownVisible}}
<div class="mumble-panel-header">
{{fa-icon "server"}} {{server.name}}
Expand Down

0 comments on commit 5cdea1c

Please sign in to comment.