fix save as collection in documents section

This commit is contained in:
j 2020-01-17 23:34:07 +01:00
parent d3f2cf770f
commit 7fa2a8a338
2 changed files with 19 additions and 7 deletions

View file

@ -37,6 +37,7 @@ pandora.ui.documentFilterForm = function(options) {
return item.id;
})
}]),
listName: Ox._('Collection'),
list: mode == 'find' ? {
sort: pandora.user.ui.collectionSort,
view: pandora.user.ui.collectionView

View file

@ -12,7 +12,9 @@ pandora.ui.filterDialog = function() {
click: function() {
var list = pandora.$ui.filterForm.getList();
if (list.save) {
pandora.api.addList({
pandora.api[
pandora.user.ui.section == 'documents' ? 'addCollection' : 'addList'
]({
name: list.name,
query: list.query,
status: 'private',
@ -20,12 +22,21 @@ pandora.ui.filterDialog = function() {
}, function(result) {
var $list = pandora.$ui.folderList.personal,
id = result.data.id;
pandora.UI.set({
find: {
conditions: [{key: 'list', value: id, operator: '=='}],
operator: '&'
}
});
if (pandora.user.ui.section) {
pandora.UI.set({
findDocuments: {
conditions: [{key: 'collection', value: id, operator: '=='}],
operator: '&'
}
});
} else {
pandora.UI.set({
find: {
conditions: [{key: 'list', value: id, operator: '=='}],
operator: '&'
}
});
}
Ox.Request.clearCache(); // fixme: remove
$list.bindEventOnce({
load: function(data) {