Commit e8d0f911 by Dányi Bence

one: delete confirmation window added

parent 7f2b2920
......@@ -338,15 +338,23 @@ $(function() {
* Deletes the specified file (or folder)
*/
self.delete = function(item) {
$.ajax({
type: 'POST',
data: 'rm=' + self.currentPath() + item.originalName,
url: '/ajax/store/delete',
dataType: 'json',
success: function(data) {
self.files.remove(item);
}
})
$('#modal').show();
$('#modal-container').html('Biztosan törlöd a(z) <strong>' + item.originalName + '</strong> ' + (item.type == 'fájl' ? 'fájlt' : 'mappát (és a teljes tartalmát)') + '? <br /><input class="ok" type="button" value="Naná!" style="float: left"/><input class="cancel" type="button" value="Fittyfenét!" style="float: right" />');
$('#modal-container .ok').click(function() {
$('#modal').hide();
$.ajax({
type: 'POST',
data: 'rm=' + self.currentPath() + item.originalName,
url: '/ajax/store/delete',
dataType: 'json',
success: function(data) {
self.files.remove(item);
}
})
});
$('#modal-container .cancel').click(function() {
$('#modal').hide();
});
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment