DataTransfer (engine/view)
@ckeditor/ckeditor5-engine/src/view/datatransfer
A facade over the native DataTransfer
object.
Filtering
Properties
-
dropEffect : 'link' | 'none' | 'copy' | 'move'
module:engine/view/datatransfer~DataTransfer#dropEffect
-
effectAllowed : 'link' | 'none' | 'copy' | 'move' | 'copyLink' | 'copyMove' | 'linkMove' | 'all' | 'uninitialized'
module:engine/view/datatransfer~DataTransfer#effectAllowed
Parameters
value : 'link' | 'none' | 'copy' | 'move' | 'copyLink' | 'copyMove' | 'linkMove' | 'all' | 'uninitialized'
-
The array of files created from the native
DataTransfer#files
orDataTransfer#items
. -
Whether the dragging operation was canceled.
-
Returns an array of available native content types.
-
The array of files created from the native
DataTransfer#files
orDataTransfer#items
. -
The native DataTransfer object.
Methods
-
constructor( nativeDataTransfer, options = { [options.cacheFiles] } )
module:engine/view/datatransfer~DataTransfer#constructor
Parameters
nativeDataTransfer : DataTransfer
The native
DataTransfer
object.options : object
-
Properties
[ options.cacheFiles ] : boolean
Whether
files
list should be initialized in the constructor.
Defaults to
{}
-
getData( type ) → string
module:engine/view/datatransfer~DataTransfer#getData
Gets the data from the data transfer by its MIME type.
dataTransfer.getData( 'text/plain' );
Parameters
type : string
The MIME type. E.g.
text/html
ortext/plain
.
Returns
string
-
setData( type, data ) → void
module:engine/view/datatransfer~DataTransfer#setData
Sets the data in the data transfer.
Parameters
type : string
The MIME type. E.g.
text/html
ortext/plain
.data : string
Returns
void
-
setDragImage( image, x, y ) → void
module:engine/view/datatransfer~DataTransfer#setDragImage
Set a preview image of the dragged content.
Parameters
image : Element
x : number
y : number
Returns
void
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.