From 552ab4c3a9ac3d061c161225cd8013324fc49ee8 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 13 Apr 2013 20:11:43 +0200 Subject: [PATCH] Fix delete link killing the post instead of the file only when deleting the file. --- src/features.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/features.coffee b/src/features.coffee index b077b01f2..08982a579 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1636,20 +1636,22 @@ DeleteLink = else $.id('delPassword').value + fileOnly = $.hasClass @, 'delete-file' + form = mode: 'usrdel' - onlyimgdel: $.hasClass @, 'delete-file' + onlyimgdel: fileOnly pwd: pwd form[post.ID] = 'delete' link = @ $.ajax $.id('delform').action.replace("/#{g.BOARD}/", "/#{post.board}/"), - onload: -> DeleteLink.load link, post, @response + onload: -> DeleteLink.load link, post, fileOnly, @response onerror: -> DeleteLink.error link , cred: true form: $.formData form - load: (link, post, html) -> + load: (link, post, fileOnly, html) -> tmpDoc = d.implementation.createHTMLDocument '' tmpDoc.documentElement.innerHTML = html if tmpDoc.title is '4chan - Banned' # Ban/warn check @@ -1660,7 +1662,7 @@ DeleteLink = else if tmpDoc.title is 'Updating index...' # We're 100% sure. - (post.origin or post).kill() + (post.origin or post).kill fileOnly s = 'Deleted' link.textContent = s error: (link) ->