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() {
that.gainFocus();
if (section == 'items') {
pandora.user.ui._list && pandora.UI.set({
find: {conditions: [], operator: '&'}
pandora.UI.set({
find: {conditions: [], operator: '&'},
item: ''
});
} else if (section == 'documents') {
pandora.user.ui._collection && pandora.UI.set({
findDocuments: {conditions: [], operator: '&'}
pandora.UI.set({
findDocuments: {conditions: [], operator: '&'},
document: ''
});
} else {
pandora.UI.set(section.slice(0, -1), '');

View file

@ -71,6 +71,7 @@ pandora.ui.folderList = function(id, section) {
},
{
align: 'right',
clickable: true,
id: 'items',
format: {type: 'number'},
operator: '-',
@ -191,6 +192,7 @@ pandora.ui.folderList = function(id, section) {
},
{
align: 'right',
clickable: true,
id: 'items',
format: {type: 'number'},
operator: '-',
@ -308,7 +310,9 @@ pandora.ui.folderList = function(id, section) {
},
click: function(data) {
//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();
} else if (data.key == 'type') {
if (that.value(data.id, 'type') == 'smart') {
@ -399,6 +403,22 @@ pandora.ui.folderList = function(id, section) {
id != id_ && $list.options('selected', []);
});
}
select(section, list);
},
submit: function(data) {
var data_ = {id: data.id};
data_[data.key] = data.value;
pandora.api['edit' + folderItem](data_, function(result) {
if (result.data.id != data.id) {
Ox.Request.clearCache();
pandora.renameList(data.id, result.data.id, result.data.name, id);
pandora.$ui.info.updateListInfo();
}
});
}
});
function select(section, list) {
if (section == 'items') {
pandora.UI.set({
find: {
@ -430,18 +450,7 @@ pandora.ui.folderList = function(id, section) {
} else {
pandora.UI.set(section.slice(0, -1), list);
}
},
submit: function(data) {
var data_ = {id: data.id};
data_[data.key] = data.value;
pandora.api['edit' + folderItem](data_, function(result) {
if (result.data.id != data.id) {
Ox.Request.clearCache();
pandora.renameList(data.id, result.data.id, result.data.name, id);
pandora.$ui.info.updateListInfo();
}
});
}
});
return that;
};