edit smart edit query

This commit is contained in:
j 2014-02-06 10:52:10 +00:00
parent 491a9f6a3f
commit a755177763
2 changed files with 31 additions and 14 deletions

View file

@ -65,6 +65,17 @@ pandora.ui.filterForm = function(list) {
that.updateResults = function() { that.updateResults = function() {
if (list) { if (list) {
Ox.Request.clearCache(list.id); Ox.Request.clearCache(list.id);
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({ pandora.$ui.list && pandora.$ui.list.bindEventOnce({
init: function(data) { init: function(data) {
pandora.$ui.folderList[ pandora.$ui.folderList[
@ -76,6 +87,7 @@ pandora.ui.filterForm = function(list) {
pandora.$ui.filters && pandora.$ui.filters.forEach(function($filter) { pandora.$ui.filters && pandora.$ui.filters.forEach(function($filter) {
$filter.reloadList(); $filter.reloadList();
}); });
}
} else { } else {
pandora.UI.set({find: Ox.clone(that.$filter.options('query'), true)}); pandora.UI.set({find: Ox.clone(that.$filter.options('query'), true)});
pandora.$ui.findElement.updateElement(); pandora.$ui.findElement.updateElement();

View file

@ -140,8 +140,10 @@ pandora.ui.listDialog = function(section) {
} }
}); });
if (pandora.user.ui.section == 'items') {
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0}); $($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
$($dialog.$element.find('.OxBar')[2]).append($updateCheckbox); $($dialog.$element.find('.OxBar')[2]).append($updateCheckbox);
}
function getWidth(section) { function getWidth(section) {
return section == 'general' ? 496 return section == 'general' ? 496
@ -440,9 +442,12 @@ pandora.ui.listIconPanel = function(listData) {
}; };
}, },
items: function(data, callback) { items: function(data, callback) {
var listData = pandora.getListData();
pandora.api.find(Ox.extend(data, { pandora.api.find(Ox.extend(data, {
query: { 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: '&' operator: '&'
} }
}), callback); }), callback);