26 lines
474 B
JavaScript
26 lines
474 B
JavaScript
"use strict";
|
|
|
|
function isDragDropSupported() {
|
|
const div = document.body;
|
|
|
|
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;
|
|
}
|
|
|
|
/**
|
|
* Checks if the browser supports Drag & Drop (not supported on mobile devices, for example).
|
|
*
|
|
* @returns {boolean}
|
|
*/
|
|
module.exports = isDragDropSupported; |