add timestamp to function call; fix trash.js to handle multiple delete operation at once

This commit is contained in:
Björn Schießle 2013-02-19 12:38:00 +01:00
parent 7bfbfe6562
commit 211e651d72
2 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ foreach ($list as $file) {
}
OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp);
if (!OCA\Files_Trashbin\Trashbin::file_exists($filename)) {
if (!OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
$success[$i]['filename'] = $file;
$success[$i]['timestamp'] = $timestamp;
$i++;

View file

@ -36,11 +36,11 @@ $(document).ready(function() {
$.post(OC.filePath('files_trashbin','ajax','delete.php'),
{files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') },
function(result){
if ( result.status == 'success' ) {
var row = document.getElementById(result.data.filename);
for (var i = 0; i < result.data.success.length; i++) {
var row = document.getElementById(result.data.success[i].filename);
row.parentNode.removeChild(row);
} else {
deleteAction[0].outerHTML = oldHTML;
}
if (result.status != 'success') {
OC.dialogs.alert(result.data.message, 'Error');
}
});