forked from 0x2620/pandora
fix delete document dialog
This commit is contained in:
parent
dfce5b4d88
commit
16491d18b2
2 changed files with 14 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue