1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-01 16:48:32 +00:00

Added note counter flag

This commit is contained in:
CBenni 2017-05-08 23:39:52 +02:00
parent 557f56ee55
commit 61d0c0e804
2 changed files with 17 additions and 1 deletions

View file

@ -536,7 +536,9 @@ FFZ.mod_card_pages.history = {
msg_line.classList.remove('ffz-mentioned'); msg_line.classList.remove('ffz-mentioned');
history.appendChild(msg_line); history.appendChild(msg_line);
} }
FFZ.mod_card_pages.notes.update_counter(mod_card, data.comments.length)
history.scrollTop = history.scrollHeight; history.scrollTop = history.scrollHeight;
}); });
} }
@ -624,6 +626,11 @@ FFZ.mod_stats_blocks = {
FFZ.mod_card_pages.notes = { FFZ.mod_card_pages.notes = {
title: "<span>N</span>otes", title: "<span>N</span>otes",
needs_lv: true, needs_lv: true,
update_counter: function(mod_card, count) {
var tabelement = document.getElementById(mod_card.elementId).querySelector(".moderation-card__actions [data-page=notes]");
tabelement.innerHTML = '<span>N</span>otes' + ( count > 0 ? ' <div class="note-counter">' + count + '</div>' : '');
},
add_note: function(mod_card, el, note, history, last_line, do_scroll) { add_note: function(mod_card, el, note, history, last_line, do_scroll) {
if ( ! history ) if ( ! history )
@ -653,6 +660,7 @@ FFZ.mod_card_pages.notes = {
} }
history.appendChild(output); history.appendChild(output);
FFZ.mod_card_pages.notes.update_counter(mod_card, history.querySelectorAll(".message-line").length);
if ( was_at_bottom ) if ( was_at_bottom )
setTimeout(function() { history.scrollTop = history.scrollHeight }); setTimeout(function() { history.scrollTop = history.scrollHeight });

View file

@ -4182,4 +4182,12 @@ body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player[data
padding: 0; padding: 0;
display: block; display: block;
max-width: 340px; max-width: 340px;
}
.moderation-card div.note-counter {
display: inline-block;
background-color: #555;
color: white;
padding: 0 8px;
border-radius: 100%;
} }