forked from 0x2620/pandora
add to current item
This commit is contained in:
parent
40edf9dd4a
commit
1c0462393c
3 changed files with 33 additions and 29 deletions
|
@ -106,7 +106,7 @@ pandora.ui.addFilesDialog = function(options) {
|
|||
});
|
||||
|
||||
var selectItems = [];
|
||||
if (!pandora.site.itemRequiresVideo && pandora.user.ui.item) {
|
||||
if (pandora.user.ui.item && options.editable) {
|
||||
selectItems.push({
|
||||
id: 'add',
|
||||
title: Ox._(
|
||||
|
@ -114,14 +114,7 @@ pandora.ui.addFilesDialog = function(options) {
|
|||
[pandora.site.itemName.singular.toLowerCase()]
|
||||
)
|
||||
});
|
||||
selectItems.push({
|
||||
id: 'one',
|
||||
title: Ox._(
|
||||
options.items.length > 1 ? 'Create new {0} with multiple parts' : 'Create new {0}',
|
||||
[pandora.site.itemName.singular.toLowerCase()]
|
||||
)
|
||||
});
|
||||
} else {
|
||||
}
|
||||
if (options.items.length > 1) {
|
||||
selectItems.push({
|
||||
id: 'multiple',
|
||||
|
@ -134,11 +127,10 @@ pandora.ui.addFilesDialog = function(options) {
|
|||
selectItems.push({
|
||||
id: 'one',
|
||||
title: Ox._(
|
||||
'Create one {0} with multiple parts',
|
||||
options.items.length > 1 ? 'Create new {0} with multiple parts' : 'Create new {0}',
|
||||
[pandora.site.itemName.singular.toLowerCase()]
|
||||
)
|
||||
});
|
||||
}
|
||||
var $select = Ox.Select({
|
||||
items: selectItems,
|
||||
width: 256
|
||||
|
|
|
@ -270,10 +270,16 @@ pandora.ui.addItemDialog = function(options) {
|
|||
} else {
|
||||
$screen.stop();
|
||||
that.close();
|
||||
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
|
||||
id: pandora.user.ui.item,
|
||||
keys: ['editable']
|
||||
}, function(result) {
|
||||
pandora.ui.addFilesDialog({
|
||||
action: selected,
|
||||
items: items
|
||||
items: items,
|
||||
editable: pandora.user.ui.item && result.data.editable
|
||||
}).open();
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -58,10 +58,16 @@ pandora.ui.mediaExistsDialog = function(options) {
|
|||
return existing.indexOf(item.oshash) == -1;
|
||||
});
|
||||
that.close();
|
||||
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
|
||||
id: pandora.user.ui.item,
|
||||
keys: ['editable']
|
||||
}, function(result) {
|
||||
pandora.ui.addFilesDialog({
|
||||
action: options.action,
|
||||
items: items
|
||||
items: items,
|
||||
editable: pandora.user.ui.item && result.data.editable
|
||||
}).open();
|
||||
})
|
||||
}
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue