Skip to content

Instantly share code, notes, and snippets.

@stomita
Created December 25, 2013 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stomita/8121096 to your computer and use it in GitHub Desktop.
Save stomita/8121096 to your computer and use it in GitHub Desktop.
Delete link click event handler to delete the file.
function initEventHandlers() {
// ...
//
$('#fileList').on('click', 'a.delete-link', function() {
var key = $(this).parents('li').data('key');
if (confirm('Are you sure you want to delete the file "' + key + '" ?')) {
bucket.deleteObject({ Key: key }, function (err) {
updateFileList();
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment