mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 19:23:55 +00:00
Break up checkDragDropSupport conditions for readability
This commit is contained in:
parent
29d535023f
commit
027e0ca95f
1 changed files with 14 additions and 3 deletions
|
|
@ -39,9 +39,20 @@ export default class DragDrop extends Plugin {
|
|||
*/
|
||||
checkDragDropSupport() {
|
||||
const div = document.createElement('div');
|
||||
return (('draggable' in div) ||
|
||||
('ondragstart' in div && 'ondrop' in div)) &&
|
||||
'FormData' in window && 'FileReader' in window;
|
||||
|
||||
if (!('draggable' in div) || !('ondragstart' in div && 'ondrop' in div)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!('FormData' in window)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!('FileReader' in window)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
listenForEvents() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue