fix delete document dialog

This commit is contained in:
rolux 2014-01-16 02:57:15 +00:00
parent dfce5b4d88
commit 16491d18b2
2 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -418,11 +418,16 @@ pandora.ui.documentsPanel = function(options) {
}
function deleteDocuments() {
pandora.ui.deleteDocumentDialog($list.options('selected'), function() {
pandora.ui.deleteDocumentDialog(
$list.options('selected').map(function(id) {
return $list.value(id);
}),
function() {
Ox.Request.clearCache();
// ...
$list.reloadList();
}).open();
}
).open();
}
function editDocuments() {