Commit 4fa93497 authored by Ujvari Gergely's avatar Ujvari Gergely

Tab count reflects the number of both top-annotations and replies.

Instead of the normal ```Total annotations``` format and the previous ```Top level annotations``` format, now introducing the ```"Total annotations"+"Replies"``` format, if this string is shorter than 5 characters, if longer we're falling to the old ```Total annotations``` format.
Font size changed from 13.1px to 12.1px

Fixes #671
parent 9c704052
......@@ -239,7 +239,7 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
.label {
font-weight: bold;
font-family: $sansFontFamily;
font-size: 13.1px;
font-size: 12.1px;
left: 10px;
right: 2px;
position: absolute;
......
......@@ -190,12 +190,24 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
# maximum count.
max = 0
for b in @buckets
total = b.reduce (total, a) ->
subtotal = 1
total + subtotal
info = b.reduce (info, a) ->
subtotal = (a.thread?.flattenChildren()?.length or 0)
return {
top: (info.top or 0) + 1
replies: (info.replies or 0) + subtotal
total : (info.total or 0) + subtotal + 1
}
, 0
max = Math.max max, total
b.total = total
max = Math.max max, info.total
b.total = info.total
b.top = info.top
b.replies = info.replies
# Set up displayed number in a tab.
# Format: <top>+<replies> if this string is no longer than 4 characters
# Otherwise display: <ŧotal>
temp = b.top + '+' + b.replies
b.display = if temp.length < 5 then temp else b.total
# Set up the stop interpolations for data binding
stopData = $.map @buckets, (bucket, i) =>
......@@ -258,7 +270,7 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
"#{(@index[d] + @index[d+1]) / 2}px"
.html (d) =>
"<div class='label'>#{@buckets[d].total}</div><div class='svg'></div>"
"<div class='label'>#{@buckets[d].display}</div><div class='svg'></div>"
.classed('upper', @isUpper)
.classed('lower', @isLower)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment