Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Feb 10, 2015
1 parent c921fd2 commit 8f49631
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,24 @@ var Image = React.createClass({
configureDragDrop(registerType) {

// Specify all supported types by calling registerType(type, { dragSource?, dropTarget? })

registerType(ItemTypes.IMAGE, {

// dragSource, when specified, is { beginDrag(component), canDrag(component)?, endDrag(component, dropEffect)? }
// dragSource, when specified, is {
// beginDrag(component),
// canDrag(component)?,
// endDrag(component, dropEffect)?
// }

dragSource: {

// beginDrag should return { item, dragAnchors?, dragPreview?, dragEffect? }
// beginDrag should return {
// item,
// dragAnchors?,
// dragPreview?,
// dragEffect?
// }

beginDrag(component) {
return {
item: component.props.image
Expand Down Expand Up @@ -181,12 +193,7 @@ var ImageBlock = React.createClass({
render() {

// {...this.dropTargetFor(ItemTypes.IMAGE)} will expand into
// {
// onDragEnter: (handled by mixin),
// onDragOver: (handled by mixin),
// onDragLeave: (handled by mixin),
// onDrop: (handled by mixin) }
// }
// { onDragEnter: (handled by mixin), onDragOver: (handled by mixin), onDragLeave: (handled by mixin), onDrop: (handled by mixin) }

return (
<div {...this.dropTargetFor(ItemTypes.IMAGE)}>
Expand Down

0 comments on commit 8f49631

Please sign in to comment.