Skip to content

Instantly share code, notes, and snippets.

@mrloop
Last active August 29, 2015 14:06
Show Gist options
  • Save mrloop/f0718abf498d4ad627ba to your computer and use it in GitHub Desktop.
Save mrloop/f0718abf498d4ad627ba to your computer and use it in GitHub Desktop.
Promises and dragStart options
dragStart: (ev)->
myPromise.then (data)=>
ev.dataTransfer.setData('application/json', data)
dragStart: (ev)->
App.DragPromises.set(random_key, myPromise)
ev.dataTransfer.setData('text/plain', random_key)
drop: (ev)->
key = ev.dataTransfer.getData('text/plain')
myPromise = App.DragPromises.get(key)
myPromise.then (data)->
doStuffWith(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment