mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 15:27:43 +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>
|
<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">
|
<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: Don't display background colors on custom bits badges.</li>
|
||||||
<li>Fixed: Advanced settings search box styling.</li>
|
<li>Fixed: Advanced settings search box styling.</li>
|
||||||
<li>Fixed: ITAD button showing in places it shouldn't.</li>
|
<li>Fixed: ITAD button showing in places it shouldn't.</li>
|
||||||
|
|
|
@ -628,8 +628,12 @@ FFZ.mod_card_pages.notes = {
|
||||||
needs_lv: true,
|
needs_lv: true,
|
||||||
|
|
||||||
update_counter: function(mod_card, count) {
|
update_counter: function(mod_card, count) {
|
||||||
var tabelement = document.getElementById(mod_card.elementId).querySelector(".moderation-card__actions [data-page=notes]");
|
var el = mod_card.get('element'),
|
||||||
tabelement.innerHTML = '<span>N</span>otes' + ( count > 0 ? ' <div class="note-counter">' + count + '</div>' : '');
|
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) {
|
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;
|
mod_card._lv_sock_user = user_id;
|
||||||
f.lv_ws_sub('logs-' + room_id + '-' + 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 ) {
|
if ( data.length ) {
|
||||||
var last_line = null;
|
var last_line = null;
|
||||||
for(var i=0; i < data.length; i++)
|
for(var i=0; i < data.length; i++)
|
||||||
|
@ -787,7 +793,7 @@ FFZ.mod_card_pages.notes = {
|
||||||
});
|
});
|
||||||
|
|
||||||
if ( mod_card.lv_write_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),
|
note_container = utils.createElement('div', 'moderation-card__actions textarea-contain note-input', textarea),
|
||||||
btn_submit = utils.createElement('a', 'button float-right', 'Add Note'),
|
btn_submit = utils.createElement('a', 'button float-right', 'Add Note'),
|
||||||
btn_container = utils.createElement('div', 'chat-buttons-container clearfix', btn_submit),
|
btn_container = utils.createElement('div', 'chat-buttons-container clearfix', btn_submit),
|
||||||
|
|
|
@ -4201,11 +4201,3 @@ body.ffz-sidebar-swap .app-main.theatre #main_col:not(.expandRight) #player[data
|
||||||
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%;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue