mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
3.5.481. Clean up the mod card note count code.
This commit is contained in:
parent
6d708184b4
commit
e843a3bb19
3 changed files with 13 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
|||
<div class="list-header">3.5.481 <time datetime="2017-05-09">(2017-05-09)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Added: Display the number of Notes a user has on moderation cards, once the data is loaded.</li>
|
||||
<li>Fixed: Don't display background colors on custom bits badges.</li>
|
||||
<li>Fixed: Advanced settings search box styling.</li>
|
||||
<li>Fixed: ITAD button showing in places it shouldn't.</li>
|
||||
|
|
|
@ -536,9 +536,9 @@ FFZ.mod_card_pages.history = {
|
|||
msg_line.classList.remove('ffz-mentioned');
|
||||
history.appendChild(msg_line);
|
||||
}
|
||||
|
||||
|
||||
FFZ.mod_card_pages.notes.update_counter(mod_card, data.comments.length)
|
||||
|
||||
|
||||
history.scrollTop = history.scrollHeight;
|
||||
});
|
||||
}
|
||||
|
@ -626,10 +626,14 @@ FFZ.mod_stats_blocks = {
|
|||
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>' : '');
|
||||
var el = mod_card.get('element'),
|
||||
notes_tab = el && el.querySelector('.moderation-card__actions [data-page=notes]');
|
||||
|
||||
if ( notes_tab )
|
||||
notes_tab.innerHTML = FFZ.mod_card_pages.notes.title +
|
||||
(count > 0 ? ' <div class="pill">' + utils.number_commas(count) + '</div>' : '');
|
||||
},
|
||||
|
||||
add_note: function(mod_card, el, note, history, last_line, do_scroll) {
|
||||
|
@ -774,6 +778,8 @@ FFZ.mod_card_pages.notes = {
|
|||
mod_card._lv_sock_user = user_id;
|
||||
f.lv_ws_sub('logs-' + room_id + '-' + user_id);
|
||||
|
||||
FFZ.mod_card_pages.notes.update_counter(mod_card, data.length);
|
||||
|
||||
if ( data.length ) {
|
||||
var last_line = null;
|
||||
for(var i=0; i < data.length; i++)
|
||||
|
@ -787,7 +793,7 @@ FFZ.mod_card_pages.notes = {
|
|||
});
|
||||
|
||||
if ( mod_card.lv_write_notes ) {
|
||||
var textarea = utils.createElement('textarea', 'chat_text_input mousetrap note-text-input'),
|
||||
var textarea = utils.createElement('textarea', 'chat_text_input mousetrap form__input note-text-input'),
|
||||
note_container = utils.createElement('div', 'moderation-card__actions textarea-contain note-input', textarea),
|
||||
btn_submit = utils.createElement('a', 'button float-right', 'Add Note'),
|
||||
btn_container = utils.createElement('div', 'chat-buttons-container clearfix', btn_submit),
|
||||
|
|
|
@ -4200,12 +4200,4 @@ body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player[data
|
|||
padding: 0;
|
||||
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