Opened 4 years ago

# use a dedicated drop-zone instead whole HTML page

Reported by: Owned by: c.steinke@… Jun Omae normal TracDragDropPlugin normal clemens

### Description

Dropping upload files into the browser window is a very nice feature. But can we restrict the "active drop-zone" i.e. where file can be dropped to a smaller box e.g. the "drop file here" box?

The file drop shall be active only when moving the mouse over this drop-zone. This will avoid that user are confuse by the drag&drop feature when moving arbitrary file over the browser window. They may not have the intention to actually drag&drop files in TRAC.

Thanks
Clemens

### comment:2 Changed 7 months ago by clemens

With the following hack I was able to let only the "attachment" section of a ticket be the drop zone. I am not an expert in Javascript. My hack is more like trial & error.

• ## tracdragdrop.js

 function prepareDragEvents(form) { var replace = form.find('[name=replace]')[0]; var body = document.body; var elements = $('html'); var body =$('#attachments'); var elements = $('#attachments'); var mask =$('
'); var indicator = \$('
'); var hint_texts = [_("You may replace files by dropping files with " +

### Modify Ticket

Change Properties
Action
as new The owner will remain Jun Omae.