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() {
|
that.updateResults = function() {
|
||||||
if (list) {
|
if (list) {
|
||||||
Ox.Request.clearCache(list.id);
|
Ox.Request.clearCache(list.id);
|
||||||
pandora.$ui.list && pandora.$ui.list.bindEventOnce({
|
if (pandora.user.ui.section == 'edits') {
|
||||||
init: function(data) {
|
pandora.$ui.folderList[
|
||||||
pandora.$ui.folderList[
|
pandora.getListData().folder
|
||||||
pandora.getListData().folder
|
].value(list.id, 'query', that.$filter.options('query'));
|
||||||
].value(list.id, 'query', that.$filter.options('query'));
|
pandora.api.editEdit({
|
||||||
}
|
id: list.id,
|
||||||
})
|
query: that.$filter.options('query')
|
||||||
.reloadList();
|
}, function(result) {
|
||||||
pandora.$ui.filters && pandora.$ui.filters.forEach(function($filter) {
|
pandora.$ui.editPanel.updatePanel();
|
||||||
$filter.reloadList();
|
});
|
||||||
});
|
} 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 {
|
} 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();
|
||||||
|
|
|
@ -140,8 +140,10 @@ pandora.ui.listDialog = function(section) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
|
if (pandora.user.ui.section == 'items') {
|
||||||
$($dialog.$element.find('.OxBar')[2]).append($updateCheckbox);
|
$($updateCheckbox.find('.OxButton')[0]).css({margin: 0});
|
||||||
|
$($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);
|
||||||
|
|
Loading…
Reference in a new issue