From a6cbde4eb3362517ac62612550aa9b86412a690d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 16 Aug 2014 19:07:51 -0700 Subject: [PATCH] better fix: move unread count back inside link --- src/General/css/style.css | 12 +++++++----- src/Monitoring/ThreadWatcher.coffee | 18 +++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/General/css/style.css b/src/General/css/style.css index 7d66ed523..c4dc1d210 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -575,21 +575,23 @@ span.hide-announcement { padding-top: 3px; } #watched-threads > div { - max-width: 250px; padding-left: 3px; padding-right: 3px; - display: -webkit-flex; - display: flex; +} +#watched-threads .watcher-link { + max-width: 250px; + display: -webkit-inline-flex; + display: inline-flex; -webkit-flex-direction: row; flex-direction: row; } -#watched-threads > div > .watched-thread-link { +#watched-threads .watcher-title { overflow: hidden; text-overflow: ellipsis; -webkit-flex: 0 1 auto; flex: 0 1 auto; } -#watched-threads > div > :not(.watched-thread-link) { +#watched-threads .watcher-unread { -webkit-flex: 0 0 auto; flex: 0 0 auto; } diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 06382f324..a6087db9b 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -177,26 +177,30 @@ ThreadWatcher = x = $.el 'a', className: 'fa fa-times' href: 'javascript:;' - textContent: '\u00A0' $.on x, 'click', ThreadWatcher.cb.rm + title = $.el 'span', + textContent: data.excerpt + className: 'watcher-title' + + count = $.el 'span', + textContent: if data.unread? then "\u00A0(#{data.unread})" else '' + className: 'watcher-unread' + if Conf['404 Redirect'] and data.isDead href = Redirect.to 'thread', {boardID, threadID} link = $.el 'a', href: href or "/#{boardID}/thread/#{threadID}" - textContent: data.excerpt title: data.excerpt - className: 'watched-thread-link' - - count = $.el 'span', - textContent: if data.unread? then "\u00A0(#{data.unread})" else '' + className: 'watcher-link' + $.add link, [title, count] div = $.el 'div' fullID = "#{boardID}.#{threadID}" div.dataset.fullID = fullID $.addClass div, 'current' if g.VIEW is 'thread' and fullID is "#{g.BOARD}.#{g.THREADID}" $.addClass div, 'dead-thread' if data.isDead - $.add div, [x, link, count] + $.add div, [x, $.tn(' '), link] div refresh: -> nodes = []