A Fake Clipboard for pseudo HTML5 Drag and Drop.
new (require("bajaux/container/wb/Clipboard"))()
A fake Clipboard to support drag and drop in Workbench.
Requires
- module:jquery
- module:baja
Methods
-
<static> dragover(x, y, navNodesStr)
-
The drag over function to be exported for Workbench to use.
Parameters:
Name Type Description x
Number The x co-ordinate of the drag.
y
Number The y co-ordinate of the drag.
navNodesStr
String The Nav Node JSON encoded in a String.
Returns:
A promise that's resolved once the drag operation has completed.
- Type
- Promise
-
<static> drop(x, y, navNodesStr)
-
The drop function to be exported for Workbench to use.
Parameters:
Name Type Description x
Number The x co-ordinate of the drop.
y
Number The y co-ordinate of the drop.
navNodesStr
String The Nav Node JSON encoded in a String.
Returns:
A promise that's resolved once the drag operation has completed.
- Type
- Promise
-
clearData(mimeType)
-
Clear the data from the clipboard for the specified format.
Parameters:
Name Type Description mimeType
String The format of the data being cleared.
-
getData(mimeType)
-
Return data from the clipboard for the specified format.
Parameters:
Name Type Description mimeType
String The format of the data to return.
Returns:
the request data (or undefined if nothing can be found).
-
setData(mimeType, data)
-
Adds the specified data to the clipboard.
Parameters:
Name Type Description mimeType
String The format of the data being added.
data
The data to be added to the clipboard.
-
setDragImage()
-
Sets a drag image (currently is a no-op).