Convert the drag-and-drop support to Backbone.js views.

Review Request #3708 — Created Dec. 31, 2012 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Convert the drag-and-drop support to Backbone.js views.

The file attachment DnD code has moved to DnDUploader and
DnDOverlayView objects.

DnDUploader handles listening for incoming dragenter events, creating the
overlay, and listening for file drops on the overlay.

DnDOverlayView displays the "Drop to Upload" overlay. It works just like
the previous one did, but the code has been made much simpler. We used
to have to deal with two drop boxes (screenshots and file attachments),
which complicated DnD events quite a bit (since we'd get dragleaves when
moving between elements). Now it's one element completely (a div with
text), so much of the heuristics have been able to be removed, including
the delay in fading out the overlay.

The CSS has been moved out to a dndUploader.less file, allowing us to
stay better organized.
Tested dragging over the page and dropping. Saw the temporary thumbnail
and the resulting real thumbnail.

Tested dragging over and hitting escape to cancel. Saw the overlay close.

Tested dragging over and back out. Saw the overlay close.

Tested dragging over, out, over, out, repeatedly. Saw the overlay fade out
and come back each time. Wasn't terrible.
    Loading...