Add a special case when downloading one file to name the tar after the file, not the enclosing directory.
This commit is contained in:
parent
08cd031367
commit
4b1ca1970a
1 changed files with 9 additions and 1 deletions
|
@ -29,9 +29,17 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
|
||||
var type = settings.type;
|
||||
var extension = (type === 'shell-zip') ? 'zip' : 'tar';
|
||||
|
||||
var name;
|
||||
if (selectedItems.length === 1) {
|
||||
name = selectedItems[0].label;
|
||||
} else {
|
||||
name = settings.packageName || location.getItem().label;
|
||||
}
|
||||
|
||||
var query = {
|
||||
action: 'download',
|
||||
as: (settings.packageName || location.getItem().label) + '.' + extension,
|
||||
as: name + '.' + extension,
|
||||
type: type,
|
||||
hrefs: _.pluck(selectedItems, 'absHref').join('|:|')
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue