1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Fix post deletion

This commit is contained in:
8chan 2015-04-20 04:20:17 -07:00 committed by czaks
parent 5f10badee9
commit 6b04b3c671
2 changed files with 4 additions and 3 deletions

View File

@ -1130,6 +1130,8 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) {
$files = json_decode($post['files']);
$file_to_delete = $file !== false ? $files[(int)$file] : (object)array('file' => false);
if (!$files[0]) error(_('That post has no files.'));
if ($files[0]->file == 'deleted' && $post['num_files'] == 1 && !$post['thread'])
return; // Can't delete OP's image completely.

View File

@ -11,7 +11,7 @@
if (active_page == 'thread' || active_page == 'index') {
$(document).ready(function(){
if ($('.delete #password').length) {
if ($('#delete-fields #password').length) {
Menu.add_item("delete_post_menu", _("Delete post"));
Menu.add_item("delete_file_menu", _("Delete file"));
Menu.onclick(function(e, $buf) {
@ -53,9 +53,8 @@ Menu.onclick(function(e, $buf) {
});
$(document).on('new_post', function(){
$('div.delete').hide();
$('input.delete').hide();
});
$('div.delete').hide();
$('input.delete').hide();
$('#post-moderation-fields').hide();
})}