Last active
August 29, 2015 14:06
-
-
Save mrloop/f0718abf498d4ad627ba to your computer and use it in GitHub Desktop.
Promises and dragStart options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dragStart: (ev)-> | |
myPromise.then (data)=> | |
ev.dataTransfer.setData('application/json', data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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