diff --git a/static/js/deleteDocumentDialog.js b/static/js/deleteDocumentDialog.js index 02829cf2a..ad34464a7 100644 --- a/static/js/deleteDocumentDialog.js +++ b/static/js/deleteDocumentDialog.js @@ -21,13 +21,15 @@ pandora.ui.deleteDocumentDialog = function(files, callback) { click: function() { that.close(); pandora.api.removeDocument({ - ids: files + ids: files.map(function(file) { + return file.id; + }) }, callback); } }) ], content: files.length == 1 - ? Ox._('Are you sure you want to delete the document "{0}"?', [files[0]]) + ? Ox._('Are you sure you want to delete the document "{0}"?', [files[0].name + '.' + files[0].extension]) : Ox._('Are you sure you want to delete {0} documents?', [files.length]), keys: {enter: 'delete', escape: 'keep'}, title: files.length == 1 diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index af2532f24..5d065e59e 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -418,11 +418,16 @@ pandora.ui.documentsPanel = function(options) { } function deleteDocuments() { - pandora.ui.deleteDocumentDialog($list.options('selected'), function() { - Ox.Request.clearCache(); - // ... - $list.reloadList(); - }).open(); + pandora.ui.deleteDocumentDialog( + $list.options('selected').map(function(id) { + return $list.value(id); + }), + function() { + Ox.Request.clearCache(); + // ... + $list.reloadList(); + } + ).open(); } function editDocuments() {