Config
Table of Contents

Class

O.DragDataSource

Represents a set of data for a drag operation. This can either be instantiated like so:

var ddsource = new O.DragDataSource({
    'text/plain': 'My *data*',
    'text/html': 'My data'
});

or used as a mixin in another class.

"use strict";

( function ( NS ) {

NS.DragDataSource = {

Constructor

O.DragDataSource( dragData )

Parameters

dragDataObject An object with data types as keys and the data itself as the values.
init: function ( dragData ) {
   if ( !dragData ) { dragData = {}; }
   this._dragData = dragData;
   this.dragDataTypes = Object.keys( dragData );
   this.get = function ( key ) {
     return this[ key ];
   };
 },

Property

O.DragDataSource#isDragDataSource

  • Boolean

Identifies the object as a drag data source, even if used as a mixin.

isDragDataSource: true,

Property

O.DragDataSource#allowedDragEffects

The effects allowed on the data.

allowedDragEffects: NS.DragEffect.ALL,

Property

O.DragDataSource#dragDataTypes

  • String[]

The list of data types available in this data source.

dragDataTypes: [],

Method

O.DragController.getDragDataOfType( type, drag )

Parameters

typeString The data type required.
dragO.Drag The drag instance representing the data.

Returns

* The data of the requested type, if available.

getDragDataOfType: function ( type/*, drag*/ ) {
   return this._dragData[ type ];
 }
};

}( O ) );
Animation
Application
Core
DataStore
DOM
DragDrop
Foundation
IO
Localisation
Selection
Parser
TimeZones
Storage
Touch
CollectionViews
UA
ContainerViews
ControlViews
PanelViews
View