forked from 0x2620/pandora
fix save as collection in documents section
This commit is contained in:
parent
d3f2cf770f
commit
7fa2a8a338
2 changed files with 19 additions and 7 deletions
|
@ -37,6 +37,7 @@ pandora.ui.documentFilterForm = function(options) {
|
||||||
return item.id;
|
return item.id;
|
||||||
})
|
})
|
||||||
}]),
|
}]),
|
||||||
|
listName: Ox._('Collection'),
|
||||||
list: mode == 'find' ? {
|
list: mode == 'find' ? {
|
||||||
sort: pandora.user.ui.collectionSort,
|
sort: pandora.user.ui.collectionSort,
|
||||||
view: pandora.user.ui.collectionView
|
view: pandora.user.ui.collectionView
|
||||||
|
|
|
@ -12,7 +12,9 @@ pandora.ui.filterDialog = function() {
|
||||||
click: function() {
|
click: function() {
|
||||||
var list = pandora.$ui.filterForm.getList();
|
var list = pandora.$ui.filterForm.getList();
|
||||||
if (list.save) {
|
if (list.save) {
|
||||||
pandora.api.addList({
|
pandora.api[
|
||||||
|
pandora.user.ui.section == 'documents' ? 'addCollection' : 'addList'
|
||||||
|
]({
|
||||||
name: list.name,
|
name: list.name,
|
||||||
query: list.query,
|
query: list.query,
|
||||||
status: 'private',
|
status: 'private',
|
||||||
|
@ -20,12 +22,21 @@ pandora.ui.filterDialog = function() {
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
var $list = pandora.$ui.folderList.personal,
|
var $list = pandora.$ui.folderList.personal,
|
||||||
id = result.data.id;
|
id = result.data.id;
|
||||||
|
if (pandora.user.ui.section) {
|
||||||
|
pandora.UI.set({
|
||||||
|
findDocuments: {
|
||||||
|
conditions: [{key: 'collection', value: id, operator: '=='}],
|
||||||
|
operator: '&'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
pandora.UI.set({
|
pandora.UI.set({
|
||||||
find: {
|
find: {
|
||||||
conditions: [{key: 'list', value: id, operator: '=='}],
|
conditions: [{key: 'list', value: id, operator: '=='}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Ox.Request.clearCache(); // fixme: remove
|
Ox.Request.clearCache(); // fixme: remove
|
||||||
$list.bindEventOnce({
|
$list.bindEventOnce({
|
||||||
load: function(data) {
|
load: function(data) {
|
||||||
|
|
Loading…
Reference in a new issue