Created
July 18, 2012 08:07
-
-
Save alexandernst/3134948 to your computer and use it in GitHub Desktop.
Backbone View listening for finished uploads
This file contains hidden or 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
var myView = Backbone.View.extend({ | |
events: { | |
'click .start_upload': 'start_upload' | |
} | |
initialize: function(){ | |
EventBus.addEventListener("upload_done", this.upload_callback); | |
} | |
start_upload: function(){ | |
// form.submit() ... | |
// more stuff ... | |
} | |
upload_callback: function(event, id){ | |
console.log("Upload finished. ID ", id, " was returned."); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment