jQuery-File-Upload icon indicating copy to clipboard operation
jQuery-File-Upload copied to clipboard

Suggested Change - Avoid form hijacking

Open kdmcclel opened this issue 15 years ago • 1 comments

Remove addClass from container, ensure it is added to dropZone. dropZone is set with container by default so this doesn't break anything. Just stops the form from being taken over by the class when all you want is the dropzone.

change line 519: container .data(settings.namespace, fileUpload) .addClass(settings.cssClass); settings.dropZone.not(container).addClass(settings.cssClass);

to: container .data(settings.namespace, fileUpload); settings.dropZone.addClass(settings.cssClass);

kdmcclel avatar Mar 22 '11 15:03 kdmcclel

There is a reason the class is added to both the container and the dropZone as both have styling implications:

  • The dropZone for the area that files can get dropped on.
  • The container for the enclosed file input button, that is used to select files.

To style the dropZone but not the container you only have to adjust the CSS definitions to be more specific and not style every element with class file_upload.

blueimp avatar Mar 23 '11 04:03 blueimp