Active
Project:
Drag'n'Drop Uploads
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 May 2012 at 09:31 UTC
Updated:
15 May 2012 at 09:31 UTC
The scripting doesn't remove old messages when reuploading a file with an unallowed file type. So if I upload 2 zips while zip is not allowed then I'll see 2 messages.
This code removes duplicate messages:
var id = $(Drupal.settings.dragNDropUploads.dropzone.wrapper + ' .form-submit[value="' + Drupal.settings.dragNDropUploads.dropzone.submit + '"]:first').attr('id');
if (Drupal.settings.ajax[id] != undefined) {
$('#' + Drupal.settings.ajax[id].wrapper).prev('.messages').unwrap().remove();
}
I've added this after:
// Upload and cleanup.
$(dropFile).change(function() {
$('#dragndrop-uploads').hide();
$(origFile).replaceWith(dropFile);
Drupal.settings.dragNDropUploads.trigger = true;