ludo.effect.DragDrop


new ludo.effect.DragDrop(config)

effect.Drag with support for drop events.

Parameters:
Name Type Description
config Object
Properties
Name Type Description
captureRegions. Boolean

True to capture regions. When set, events like "north", "south", "west" and "east"
will be fired when dragging over drop points.

Source:
Fires:
  • ludo.effect.Dragdrop#enterDropTarget Fired when entering drop target DOM node. Arguments: 1) DOM dragged 2) DOM drop target, 3) ludo.effect.DragDrop, 4) event.event:target
  • ludo.effect.Dragdrop#validDropTarget Fired when entering valid drop target DOM node. Arguments: 1) DOM dragged 2) DOM drop target, 3) ludo.effect.DragDrop, 4) event.event:target
  • ludo.effect.Dragdrop#invalidDropTarget Fired when entering invalid drop target DOM node. This happens when you have an event handler on enterDropTarget and call the setInvalid method. Arguments: 1) DOM dragged 2) DOM drop target, 3) ludo.effect.DragDrop, 4) event.targetevent:
  • ludo.effect.Dragdrop#drop Fired on drop. Arguments: 1) DOM dragged 2) DOM drop target, 3) ludo.effect.DragDrop, 4) event.event:target
  • ludo.effect.Dragdrop#north When captureRegions is set, this event is fired when entering north region of a drop point.event: Same arguments as otehr drop events.
  • ludo.effect.Dragdrop#south When captureRegions is set, this event is fired when entering south region of a drop point.event: Same arguments as otehr drop events.
  • ludo.effect.Dragdrop#west When captureRegions is set, this event is fired when entering west region of a drop point.event: Same arguments as otehr drop events.
  • ludo.effect.Dragdrop#east When captureRegions is set, this event is fired when entering east region of a drop point.event: Same arguments as otehr drop events.

Extends

  • effect.Drag

Methods


addDropTarget(node) → {ludo.effect.DropPoint}

Create new drop point.

Parameters:
Name Type Description
node ludo.effect.DropPoint
Source:
Returns:

node

Type
ludo.effect.DropPoint

remove(id) → {Boolean}

Remove node

Parameters:
Name Type Description
id String
Source:
Returns:

success

Type
Boolean

setInvalid()

Set drop point invalid. This method is usually used in connection with a listener
for the enterDropTarget event

Source:
Example
dd.addEvent('enterDropTarget', function(node, dd){
			 if(node.name === 'John Doe'){
				 dd.setInvalid(); // Triggers an invalidDropTarget event
			 }
		 });