Changed 'hide post' button behavior

This commit is contained in:
marktaiwan 2015-02-24 16:30:51 +08:00 committed by czaks
parent b469855126
commit f84d0b9027

View File

@ -243,28 +243,27 @@ if (active_page === 'thread' || active_page === 'index') {
*/ */
// unhide button // unhide button
if ($ele.data('hidden') == '1' && $ele.data('hiddenByUid') == '0' && if ($ele.data('hidden') == '1') {
$ele.data('hiddenByName') == '0' && $ele.data('hiddenByTrip') == '0') {
$buffer.find('#filter-menu-unhide').click(function () { $buffer.find('#filter-menu-unhide').click(function () {
// if hidden due to post id, remove it from blacklist // if hidden due to post id, remove it from blacklist
// otherwise just show this post // otherwise just show this post
blacklist.remove.post(pageData.boardId, threadId, postId); blacklist.remove.post(pageData.boardId, threadId, postId);
show(ele); show(ele);
}); });
$buffer.find('#filter-menu-hide').addClass('hidden');
} else { } else {
$buffer.find('#filter-menu-unhide').addClass('hidden'); $buffer.find('#filter-menu-unhide').addClass('hidden');
$buffer.find('#filter-menu-hide').click(function () {
blacklist.add.post(pageData.boardId, threadId, postId, false);
});
} }
// post id // post id
if ($ele.data('hiddenByPost') == '0') { if ($ele.data('hiddenByPost') == '0') {
$buffer.find('#filter-menu-hide').click(function () {
blacklist.add.post(pageData.boardId, threadId, postId, false);
});
$buffer.find('#filter-add-post-plus').click(function () { $buffer.find('#filter-add-post-plus').click(function () {
blacklist.add.post(pageData.boardId, threadId, postId, true); blacklist.add.post(pageData.boardId, threadId, postId, true);
}); });
} else { } else {
$buffer.find('#filter-menu-hide').addClass('hidden');
$buffer.find('#filter-add-post-plus').addClass('hidden'); $buffer.find('#filter-add-post-plus').addClass('hidden');
} }