From 0aa116e6f6e65e902152ec75e2b6cf0509afd7a1 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 25 Sep 2013 10:39:57 -0700 Subject: [PATCH] Always show unread count instead of only on hover. Fix unread count in bookmarks list --- clientapp/models/muc.js | 9 +++++++++ clientapp/views/mucListItem.js | 2 +- public/css/app/roster.styl | 8 ++++---- public/css/otalk.css | 8 ++++---- 4 files changed, 18 insertions(+), 9 deletions(-) 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,