From 4ee61d45c338723fcd53d8a779f2f705bbaac585 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Tue, 7 Oct 2014 15:07:49 -0700 Subject: [PATCH] Fixed loops in upload --- themes/grav/templates/forms/fields/uploads/uploads.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/grav/templates/forms/fields/uploads/uploads.html.twig b/themes/grav/templates/forms/fields/uploads/uploads.html.twig index eb401de2..f2b253a2 100644 --- a/themes/grav/templates/forms/fields/uploads/uploads.html.twig +++ b/themes/grav/templates/forms/fields/uploads/uploads.html.twig @@ -20,6 +20,7 @@ this.options.thumbnail.call(this, args.file, args.file.extras.url); } } else if (args.mode == 'removeFile') { + args.file.rejected = true; this.removeFile(args.file); } @@ -72,7 +73,7 @@ }); this.on('removedfile', function(file) { - if (!file.accepted) return; + if (!file.accepted || file.rejected) return; thisDropzone = this; $.post(URI + '/task:delmedia', {filename: file.name}, function(data){ $.proxy(modalError, thisDropzone, {