Modify

Opened 4 years ago

Last modified 7 months ago

#13314 new enhancement

use a dedicated drop-zone instead whole HTML page

Reported by: c.steinke@… Owned by: Jun Omae
Priority: normal Component: TracDragDropPlugin
Severity: normal Keywords:
Cc: clemens Trac Release:

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

Attachments (0)

Change History (2)

comment:1 Changed 7 months ago by clemens

Cc: clemens added

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

     
    958958
    959959    function prepareDragEvents(form) {
    960960        var replace = form.find('[name=replace]')[0];
    961         var body = document.body;
    962         var elements = $('html');
     961        var body = $('#attachments');
     962        var elements = $('#attachments');
    963963        var mask = $('<div />');
    964964        var indicator = $('<div />');
    965965        var hint_texts = [_("You may replace files by dropping files with " +

based on source:/tracdragdropplugin/0.12/tracdragdrop/htdocs/tracdragdrop.js@16998:961-962#L959

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Jun Omae.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.