Fixed delete button

This commit is contained in:
Karl Hobley 2014-07-18 13:05:34 +01:00
parent a0d79fcff1
commit 050a85203e

View file

@ -120,11 +120,13 @@ $(function(){
});
$('#upload-list').on('click', '.delete', function(e){
var form = $(this);
var form = $(this).closest('form');
e.preventDefault();
$.post(this.href, form.serialize(), function(data) {
var CSRFToken = $('input[name="csrfmiddlewaretoken"]', form).val();
$.post(this.href, {csrfmiddlewaretoken: CSRFToken}, function(data) {
if (data.success) {
itemElement.slideUp(function(){$(this).remove()});
}else{