Skip to main content

DragAndDrop

Import :

const DragAndDrop = brackets.getModule("utils/DragAndDrop")

isValidDrop(items) ⇒ boolean

Returns true if the drag and drop items contains valid drop objects.

Kind: global function
Returns: boolean - True if one or more items can be dropped.

ParamTypeDescription
itemsArray.<DataTransferItem>Array of items being dragged

openDroppedFiles(paths) ⇒ Promise

Open dropped files

Kind: global function
Returns: Promise - Promise that is resolved if all files are opened, or rejected if there was an error.

ParamTypeDescription
pathsArray.<string>Array of file paths dropped on the application.

attachHandlers()

Attaches global drag & drop handlers to this window. This enables dropping files/folders to open them, and also protects the Brackets app from being replaced by the browser trying to load the dropped file in its place.

Kind: global function