Last active
January 1, 2016 08:49
-
-
Save stomita/8121088 to your computer and use it in GitHub Desktop.
Render file list with delete link.
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
function updateFileList() { | |
bucket.listObjects({}, function(err, resp) { | |
if (err) { throw err; } | |
$('#fileList').empty(); | |
$.each(resp.Contents, function(i, content) { | |
var viewLink = $('<a href="#" class="view-link">').text(content.Key); | |
var deleteLink = $('<a href="#" class="delete-link">').text('Delete'); | |
$('<li>').data('key', content.Key) | |
.append(viewLink) | |
.append(' [') | |
.append(deleteLink) | |
.append(']') | |
.appendTo($('#fileList')); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment