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:
parent
557f56ee55
commit
61d0c0e804
2 changed files with 17 additions and 1 deletions
|
@ -537,6 +537,8 @@ FFZ.mod_card_pages.history = {
|
|||
history.appendChild(msg_line);
|
||||
}
|
||||
|
||||
FFZ.mod_card_pages.notes.update_counter(mod_card, data.comments.length)
|
||||
|
||||
history.scrollTop = history.scrollHeight;
|
||||
});
|
||||
}
|
||||
|
@ -625,6 +627,11 @@ FFZ.mod_card_pages.notes = {
|
|||
title: "<span>N</span>otes",
|
||||
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) {
|
||||
if ( ! history )
|
||||
history = el.querySelector('.chat-history.user-notes');
|
||||
|
@ -653,6 +660,7 @@ FFZ.mod_card_pages.notes = {
|
|||
}
|
||||
|
||||
history.appendChild(output);
|
||||
FFZ.mod_card_pages.notes.update_counter(mod_card, history.querySelectorAll(".message-line").length);
|
||||
|
||||
if ( was_at_bottom )
|
||||
setTimeout(function() { history.scrollTop = history.scrollHeight });
|
||||
|
|
|
@ -4183,3 +4183,11 @@ body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player[data
|
|||
display: block;
|
||||
max-width: 340px;
|
||||
}
|
||||
|
||||
.moderation-card div.note-counter {
|
||||
display: inline-block;
|
||||
background-color: #555;
|
||||
color: white;
|
||||
padding: 0 8px;
|
||||
border-radius: 100%;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue