forked from 0x2620/pandora
make 'save as list' work in advanced find
This commit is contained in:
parent
b0f12e5ac3
commit
802e461030
2 changed files with 26 additions and 1 deletions
|
@ -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]});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue