diff --git a/clientapp/models/muc.js b/clientapp/models/muc.js index 0c50862..8e3465c 100644 --- a/clientapp/models/muc.js +++ b/clientapp/models/muc.js @@ -38,6 +38,15 @@ module.exports = HumanModel.define({ return this.name || this.jid; } }, + displayUnreadCount: { + deps: ['unreadCount'], + fn: function () { + if (this.unreadCount > 0) { + return this.unreadCount.toString(); + } + return ''; + } + }, hasUnread: { deps: ['unreadCount'], fn: function () { diff --git a/clientapp/views/mucListItem.js b/clientapp/views/mucListItem.js index a8392d3..b6b338a 100644 --- a/clientapp/views/mucListItem.js +++ b/clientapp/views/mucListItem.js @@ -14,7 +14,7 @@ module.exports = HumanView.extend({ }, textBindings: { displayName: '.name', - unreadCount: '.unread' + displayUnreadCount: '.unread' }, events: { 'click': 'handleClick' diff --git a/public/css/app/roster.styl b/public/css/app/roster.styl index d0591b9..32180c4 100644 --- a/public/css/app/roster.styl +++ b/public/css/app/roster.styl @@ -63,12 +63,12 @@ -webkit-transition: all .3s ease-in 0 -moz-transition: all .3s ease-in 0 + .unread:not(:empty) + display: block + &:hover background: $sidebarActive - .unread:not(:empty) - display: block - &.online, &.chat, &.dnd, &.away, &.xa &:after @@ -175,4 +175,4 @@ 50% opacity: 0.5 100% - opacity: 1.0 \ No newline at end of file + opacity: 1.0 diff --git a/public/css/otalk.css b/public/css/otalk.css index 9eb05ff..e5086c8 100644 --- a/public/css/otalk.css +++ b/public/css/otalk.css @@ -380,14 +380,14 @@ h3 { -webkit-transition: all 0.3s ease-in 0; -moz-transition: all 0.3s ease-in 0; } +#roster li .unread:not(:empty), +#bookmarks li .unread:not(:empty) { + display: block; +} #roster li:hover, #bookmarks li:hover { background: #1f2d49; } -#roster li:hover .unread:not(:empty), -#bookmarks li:hover .unread:not(:empty) { - display: block; -} #roster li.online:after, #bookmarks li.online:after, #roster li.chat:after,