Fix drag and drop issues on Firefox and Chrome

Review Request #8160 — Created May 12, 2016 and submitted

Information

Review Board
release-3.0.x
7f21a2c...

Reviewers

In Chrome, the DataTransfer.files attribute will not be have a
Symbol.iterator property, so it cannot be iterated through via
let...of. In Firefox, DataTransfer.types is not an array (instead,
it is a DOMStringList) which does not have the includes function in
its prototype. We solve both of these issues by using Array.from to
coerce these pseudo-arrays into proper array objects before working
on them.

Verified this drag and drop worked in both Firefox and Chrome with this
patch applied.

reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/views/dndUploaderView.es6.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/views/dndUploaderView.es6.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (fa1a8d4)