src/utils/DragAndDrop.js
function isValidDrop(items) {
        var i, len = items.length;

        for (i = 0; i < len; i++) {
            if (items[i].kind === "file") {
                var entry = items[i].webkitGetAsEntry();

                if (entry.isFile) {
                    // If any files are being dropped, this is a valid drop
                    return true;
                } else if (len === 1) {
                    // If exactly one folder is being dropped, this is a valid drop
                    return true;
                }
            }
        }

        // No valid entries found
        return false;
    }
function isValidDrop(items) {
        var i, len = items.length;

        for (i = 0; i < len; i++) {
            if (items[i].kind === "file") {
                var entry = items[i].webkitGetAsEntry();

                if (entry.isFile) {
                    // If any files are being dropped, this is a valid drop
                    return true;
                } else if (len === 1) {
                    // If exactly one folder is being dropped, this is a valid drop
                    return true;
                }
            }
        }

        // No valid entries found
        return false;
    }
function isValidDrop ( items ) { var i , len = items . length ; for ( i = 0 ; i < len ; i ++ ) { if ( items [ i ] . kind === "file" ) { var entry = items [ i ] . webkitGetAsEntry ( ) ; if ( entry . isFile ) { // If any files are being dropped, this is a valid drop return true ; } else if ( len === 1 ) { // If exactly one folder is being dropped, this is a valid drop return true ; } } } // No valid entries found return false ; }
Returns true if the drag and drop items contains valid drop objects.
@param {Array.<DataTransferItem>} items Array of items being dragged
@return {boolean} True if one or more items can be dropped.
Returns true if the drag and drop items contains valid drop objects .