django-vue3-admin-web/node_modules/@uppy/utils/lib/isDragDropSupported.js
2025-10-20 21:21:14 +08:00

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;