diff --git a/static/js/documentFilterForm.js b/static/js/documentFilterForm.js index 957bb5121..a1fb25c9d 100644 --- a/static/js/documentFilterForm.js +++ b/static/js/documentFilterForm.js @@ -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 diff --git a/static/js/filterDialog.js b/static/js/filterDialog.js index 3e5b7b465..6ad2efed2 100644 --- a/static/js/filterDialog.js +++ b/static/js/filterDialog.js @@ -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) {