Skip to content

Commit

Permalink
hide parts of excess modlog
Browse files Browse the repository at this point in the history
  • Loading branch information
Unihedro committed Jun 18, 2016
1 parent 0ca7f0f commit 35d2284
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions public/javascripts/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,22 @@ $(function() {
$(this).parent('form').submit();
});
$('body').trigger('lichess.content_loaded');
var relatedUsers = +$('.reportCard thead th:last').text();
var relatedUsers = +$zone.find('.reportCard thead th:last').text();
if (relatedUsers > 100) {
$zone.find('.others').css('display', 'none').before('<a class="others-show">Show ' + relatedUsers + ' related users</a>');
$zone.find('.others-show').click(function() {
$(this).next().css('display', '');
var others = $zone.find('.others').hide()
.before('<a id="others-show">Show ' + relatedUsers + ' related users... (very large!)</a>');
$zone.find('#others-show').click(function() {
others.show();
$(this).remove();
});
}
var $modLog = $zone.find('.mod_log ul').children();
if ($modLog.length > 20) {
var list = $modLog.slice(20);
list.first().before('<a id="modlog-show">Show all ' + $modLog.length + ' mod log entries...</a>');
list.wrap('<span class="modlog-hidden" style="display:none"></span>');
$zone.find('#modlog-show').click(function() {
$zone.find('.modlog-hidden').show();
$(this).remove();
});
}
Expand Down

0 comments on commit 35d2284

Please sign in to comment.