Commit e8d0f911 by Dányi Bence

one: delete confirmation window added

parent 7f2b2920
...@@ -338,15 +338,23 @@ $(function() { ...@@ -338,15 +338,23 @@ $(function() {
* Deletes the specified file (or folder) * Deletes the specified file (or folder)
*/ */
self.delete = function(item) { self.delete = function(item) {
$.ajax({ $('#modal').show();
type: 'POST', $('#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" />');
data: 'rm=' + self.currentPath() + item.originalName, $('#modal-container .ok').click(function() {
url: '/ajax/store/delete', $('#modal').hide();
dataType: 'json', $.ajax({
success: function(data) { type: 'POST',
self.files.remove(item); 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