From e00bc4b65f3bb89ba55bd314167431170872563b Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 31 Oct 2012 01:05:40 +0100 Subject: added unreadcounter back --- css/news.css | 32 ++++++++++++++++++++++++++------ js/menu.js | 12 ++++++++---- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/css/news.css b/css/news.css index 41580cbe9..146bcb72b 100644 --- a/css/news.css +++ b/css/news.css @@ -58,6 +58,22 @@ div.add_parentfolder { } #feeds .unread_items_counter { + border-radius: .4em; + background-color: #666; + color: #fefefe; + padding: .1em .3em; + min-width: 1em; + position: absolute; + z-index: 1000; + right: .3em; + top: .3em; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + font-size: 9pt; + } + + #feeds .feed:hover .unread_items_counter, #feeds .feed.all_read .unread_items_counter { display: none; } @@ -168,7 +184,7 @@ div.add_parentfolder { #feeds li { border-bottom: 1px solid #ddd; border-top: 1px solid #fff; - padding: 0; + padding: 0 35px 0 0; font-weight: bold ; box-sizing: border-box; -moz-box-sizing: border-box; @@ -201,13 +217,17 @@ div.add_parentfolder { line-height: 2.5em; } - #feeds li:hover > a.title { - padding-right: 4em !important; + #feeds li:hover { + padding: 0; } - #feeds li.folder:hover > a.title { - padding-right: 5.5em !important; - } + #feeds li:hover > a.title { + padding-right: 4em !important; + } + + #feeds li.folder:hover > a.title { + padding-right: 5.5em !important; + } #feeds .starred a.title { background-image: url('%appswebroot%/news/img/starred.png'); diff --git a/js/menu.js b/js/menu.js index 413f23812..2b986afac 100644 --- a/js/menu.js +++ b/js/menu.js @@ -426,7 +426,7 @@ var News = News || {}; var self = this; var id = $listItem.data('id'); this._setUnreadCount(MenuNodeType.Feed, id, - this._getAndRemoveUnreadCount($listItem)); + this._getUnreadCount($listItem)); $listItem.children('.title').click(function(){ // prevent loading when dragging @@ -464,7 +464,7 @@ var News = News || {}; Menu.prototype._bindStarred = function($listItem){ var self = this; this._setUnreadCount(MenuNodeType.Starred, 0, - this._getAndRemoveUnreadCount($listItem)); + this._getUnreadCount($listItem)); $listItem.children('.title').click(function(){ self.load(MenuNodeType.Starred, -1); @@ -687,10 +687,9 @@ var News = News || {}; * @param $listItem the jquery list element * @return the count of unread items */ - Menu.prototype._getAndRemoveUnreadCount = function($listItem){ + Menu.prototype._getUnreadCount = function($listItem){ var $unreadCounter = $listItem.children('.unread_items_counter'); var unreadCount = parseInt($unreadCounter.html(), 10); - $unreadCounter.remove(); return unreadCount; }; @@ -841,6 +840,11 @@ var News = News || {}; */ Menu.prototype._applyUnreadCountStyle = function(type, id, unreadCount) { var $node = this._getNodeFromTypeAndId(type, id); + + if(type === MenuNodeType.Feed){ + $node.children('.unread_items_counter').html(unreadCount); + } + if(unreadCount === 0){ $node.addClass('all_read'); } else { -- cgit v1.2.3