Fix drag and drop issues on Firefox and Chrome
Review Request #8160 — Created May 12, 2016 and submitted
In Chrome, the
DataTransfer.filesattribute will not be have a
Symbol.iteratorproperty, so it cannot be iterated through via
let...of. In Firefox,DataTransfer.typesis not anarray(instead,
it is aDOMStringList) which does not have theincludesfunction in
its prototype. We solve both of these issues by usingArray.fromto
coerce these pseudo-arrays into properarrayobjects before working
on them.
Verified this drag and drop worked in both Firefox and Chrome with this
patch applied.
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