make 'save as list' work in advanced find

This commit is contained in:
rolux 2011-11-11 15:48:25 +00:00
parent b0f12e5ac3
commit 802e461030
2 changed files with 26 additions and 1 deletions

View file

@ -9,7 +9,32 @@ pandora.ui.filterDialog = function(list) {
})
.bindEvent({
click: function() {
var list = pandora.$ui.filterForm.$filter.getList();
that.close();
if (list.save) {
pandora.api.addList({
name: list.name,
query: list.query,
status: 'private',
type: 'smart'
}, function(result) {
var $list = pandora.$ui.folderList.personal,
id = result.data.id;
pandora.UI.set({
find: {
conditions: [{key: 'list', value: id, operator: '=='}],
operator: '&'
}
});
Ox.Request.clearCache(); // fixme: remove
$list.reloadList().bindEventOnce({
load: function(data) {
$list.gainFocus()
.options({selected: [id]});
}
});
});
}
}
})
],

View file

@ -14,7 +14,7 @@ pandora.ui.filterForm = function(list) {
sort: [{key: 'user', operator: '+'}, {key: 'name', operator: '+'}]
}, function(result) {
that.append(
Ox.Filter({
that.$filter = Ox.Filter({
findKeys: Ox.merge(Ox.map(pandora.site.itemKeys, function(itemKey) {
var key = Ox.clone(itemKey);
key.type = key.type == 'layer'