edit smart edit query
This commit is contained in:
parent
491a9f6a3f
commit
a755177763
2 changed files with 31 additions and 14 deletions
|
@ -65,17 +65,29 @@ pandora.ui.filterForm = function(list) {
|
|||
that.updateResults = function() {
|
||||
if (list) {
|
||||
Ox.Request.clearCache(list.id);
|
||||
pandora.$ui.list && pandora.$ui.list.bindEventOnce({
|
||||
init: function(data) {
|
||||
pandora.$ui.folderList[
|
||||
pandora.getListData().folder
|
||||
].value(list.id, 'query', that.$filter.options('query'));
|
||||
}
|
||||
})
|
||||
.reloadList();
|
||||
pandora.$ui.filters && pandora.$ui.filters.forEach(function($filter) {
|
||||
$filter.reloadList();
|
||||
});
|
||||
if (pandora.user.ui.section == 'edits') {
|
||||
pandora.$ui.folderList[
|
||||
pandora.getListData().folder
|
||||
].value(list.id, 'query', that.$filter.options('query'));
|
||||
pandora.api.editEdit({
|
||||
id: list.id,
|
||||
query: that.$filter.options('query')
|
||||
}, function(result) {
|
||||
pandora.$ui.editPanel.updatePanel();
|
||||
});
|
||||
} else {
|
||||
pandora.$ui.list && pandora.$ui.list.bindEventOnce({
|
||||
init: function(data) {
|
||||
pandora.$ui.folderList[
|
||||
pandora.getListData().folder
|
||||
].value(list.id, 'query', that.$filter.options('query'));
|
||||
}
|
||||
})
|
||||
.reloadList();
|
||||
pandora.$ui.filters && pandora.$ui.filters.forEach(function($filter) {
|
||||
$filter.reloadList();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
pandora.UI.set({find: Ox.clone(that.$filter.options('query'), true)});
|
||||
pandora.$ui.findElement.updateElement();
|
||||
|
|
|
@ -140,8 +140,10 @@ pandora.ui.listDialog = function(section) {
|
|||
}
|
||||
});
|
||||
|
||||
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
|
||||
$($dialog.$element.find('.OxBar')[2]).append($updateCheckbox);
|
||||
if (pandora.user.ui.section == 'items') {
|
||||
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
|
||||
$($dialog.$element.find('.OxBar')[2]).append($updateCheckbox);
|
||||
}
|
||||
|
||||
function getWidth(section) {
|
||||
return section == 'general' ? 496
|
||||
|
@ -440,9 +442,12 @@ pandora.ui.listIconPanel = function(listData) {
|
|||
};
|
||||
},
|
||||
items: function(data, callback) {
|
||||
var listData = pandora.getListData();
|
||||
pandora.api.find(Ox.extend(data, {
|
||||
query: {
|
||||
conditions: ui.section == 'items' ? [{key: 'list', value: listData.id, operator: '=='}] : [],
|
||||
conditions: ui.section == 'items'
|
||||
? [{key: 'list', value: listData.id, operator: '=='}]
|
||||
: listData.query ? listData.query.conditions : [],
|
||||
operator: '&'
|
||||
}
|
||||
}), callback);
|
||||
|
|
Loading…
Reference in a new issue