show list on click, fixes #3031

This commit is contained in:
j 2017-06-09 12:25:38 +02:00
parent 77810b49d6
commit 38341a43c6
2 changed files with 47 additions and 36 deletions

View file

@ -21,12 +21,14 @@ pandora.ui.allItems = function(section) {
click: function() { click: function() {
that.gainFocus(); that.gainFocus();
if (section == 'items') { if (section == 'items') {
pandora.user.ui._list && pandora.UI.set({ pandora.UI.set({
find: {conditions: [], operator: '&'} find: {conditions: [], operator: '&'},
item: ''
}); });
} else if (section == 'documents') { } else if (section == 'documents') {
pandora.user.ui._collection && pandora.UI.set({ pandora.UI.set({
findDocuments: {conditions: [], operator: '&'} findDocuments: {conditions: [], operator: '&'},
document: ''
}); });
} else { } else {
pandora.UI.set(section.slice(0, -1), ''); pandora.UI.set(section.slice(0, -1), '');

View file

@ -71,6 +71,7 @@ pandora.ui.folderList = function(id, section) {
}, },
{ {
align: 'right', align: 'right',
clickable: true,
id: 'items', id: 'items',
format: {type: 'number'}, format: {type: 'number'},
operator: '-', operator: '-',
@ -191,6 +192,7 @@ pandora.ui.folderList = function(id, section) {
}, },
{ {
align: 'right', align: 'right',
clickable: true,
id: 'items', id: 'items',
format: {type: 'number'}, format: {type: 'number'},
operator: '-', operator: '-',
@ -308,7 +310,9 @@ pandora.ui.folderList = function(id, section) {
}, },
click: function(data) { click: function(data) {
//var $list = pandora.$ui.folderList[id]; //var $list = pandora.$ui.folderList[id];
if (data.key == 'user') { if (data.key == 'items') {
select(section, data.id);
} else if (data.key == 'user') {
pandora.$ui.listDialog = pandora.ui.listDialog('icon').open(); pandora.$ui.listDialog = pandora.ui.listDialog('icon').open();
} else if (data.key == 'type') { } else if (data.key == 'type') {
if (that.value(data.id, 'type') == 'smart') { if (that.value(data.id, 'type') == 'smart') {
@ -399,37 +403,7 @@ pandora.ui.folderList = function(id, section) {
id != id_ && $list.options('selected', []); id != id_ && $list.options('selected', []);
}); });
} }
if (section == 'items') { select(section, list);
pandora.UI.set({
find: {
conditions: list ? [
{key: 'list', value: list, operator: '=='}
] : [],
operator: '&'
},
listView: list
? pandora.user.ui.lists[list]
? pandora.user.ui.lists[list].view
: that.value(list).view
: void 0
});
} else if (section == 'documents') {
pandora.UI.set({
findDocuments: {
conditions: list ? [
{key: 'collection', value: list, operator: '=='}
] : [],
operator: '&'
},
collectionView: list
? pandora.user.ui.collections[list]
? pandora.user.ui.collections[list].view
: that.value(list).view
: void 0
});
} else {
pandora.UI.set(section.slice(0, -1), list);
}
}, },
submit: function(data) { submit: function(data) {
var data_ = {id: data.id}; var data_ = {id: data.id};
@ -443,5 +417,40 @@ pandora.ui.folderList = function(id, section) {
}); });
} }
}); });
function select(section, list) {
if (section == 'items') {
pandora.UI.set({
find: {
conditions: list ? [
{key: 'list', value: list, operator: '=='}
] : [],
operator: '&'
},
listView: list
? pandora.user.ui.lists[list]
? pandora.user.ui.lists[list].view
: that.value(list).view
: void 0
});
} else if (section == 'documents') {
pandora.UI.set({
findDocuments: {
conditions: list ? [
{key: 'collection', value: list, operator: '=='}
] : [],
operator: '&'
},
collectionView: list
? pandora.user.ui.collections[list]
? pandora.user.ui.collections[list].view
: that.value(list).view
: void 0
});
} else {
pandora.UI.set(section.slice(0, -1), list);
}
}
return that; return that;
}; };