DragAndDrop, v2.0.0
Support drag and drop of files from desktop to web browser. To recurse through directories and filter by file type, pass the results to Directory.
Other Versions
2.0.0, 1.0.1
BrowserPlus.DragAndDrop.AddDropTarget({params}, function{}())
Starts monitoring drag/drop activity for the specified element.
Test: AddDropTarget()
Parameters
- id: string
- The 'id' of the registered DOM element to operate on.
BrowserPlus.DragAndDrop.AttachCallbacks({params}, function{}())
AttachCallbacks to a registered drop target. This function will not return until RemoveDropTarget is called, so it should not be invoked synchronously.
Test: AttachCallbacks()
Parameters
- id: string
- The 'id' of the registered DOM element to which you wish to attach.
- hover: callback (Optional)
- A function that will be invoked when the user hovers over the drop target. Argument is a boolean which when true means the user has entered the region, and when false means they have exited.
- drop: callback (Optional)
- A function that will be invoked when the user drops files on your drop target. Arguments to the callback vary depending on whether 'includeGestureInfo' was set true for the target. See the documentation for the 'includeGestureInfo' argument to 'AddDropTarget()'.
BrowserPlus.DragAndDrop.RemoveDropTarget({params}, function{}())
Stop monitoring an element for drag/drop activity.
Test: RemoveDropTarget()
Parameters
- id: string
- The 'id' of the DOM element to operate on.
BrowserPlus.DragAndDrop.EnableDropTarget({params}, function{}())
Enable/disable an element for drag/drop activity. AddDropTarget must have already been called for the element.
Test: EnableDropTarget()
Parameters
- id: string
- The 'id' of the registered DOM element for which you wish to enable/disable drag/drop activity.
- enable: boolean
- A boolean indicating whether activity should be enabled (true) or disabled (false).
BrowserPlus.DragAndDrop.ListTargets({params}, function{}())
Returns a list of the ids of the currently registered drop targets.
Test: ListTargets()
Parameters
No Parameters


