Shift-click to hide threads in catalog

This commit is contained in:
8chan 2015-01-31 23:30:59 -08:00 committed by czaks
parent 01207dfcbb
commit e8b530a783
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,4 @@
if (active_page == 'catalog') $(function(){
if (localStorage.catalog !== undefined) {
var catalog = JSON.parse(localStorage.catalog);
} else {
@ -15,8 +14,18 @@ if (active_page == 'catalog') $(function(){
$('a[href$="/'+k+'.html"]').parents('.mix').remove();
});
}
} else {
hidden_data = {};
}
$(document).on('click', '.mix', function(e) {
if (e.shiftKey) {
hidden_data[board_name][$(this).data('id')] = Math.round(Date.now() / 1000);
$(this).remove();
localStorage.hiddenthreads = JSON.stringify(hidden_data);
}
});
$("#sort_by").change(function(){
var value = this.value;
$('#Grid').mixItUp('sort', value);
@ -46,5 +55,4 @@ if (active_page == 'catalog') $(function(){
if (catalog.image_size !== undefined) {
$('#image_size').val(catalog.image_size).trigger('change');
}
});

View File

@ -37,6 +37,7 @@
data-reply="{{ post.reply_count }}"
data-bump="{{ post.bump }}"
data-time="{{ post.time }}"
data-id="{{ post.id }}"
>
<div class="thread grid-li grid-size-small">
<a href="{{post.link}}">