make smart list query editable

This commit is contained in:
rolux 2011-09-19 13:18:02 +00:00
parent ad6e6eaea2
commit 878352617f
2 changed files with 24 additions and 2 deletions

View file

@ -21,7 +21,29 @@ pandora.ui.filter = function(list) {
sortKeys: pandora.site.sortKeys,
viewKeys: pandora.site.listViews
})
.css({padding: '16px'});
.css({padding: '16px'})
.bindEvent({
change: function(data) {
if (list) {
pandora.api.editList({
id: list.id,
query: data.query
}, function(result) {
Ox.Request.clearCache(); // fixme: remove later
pandora.$ui.list
.bindEventOnce({
init: function(data) {
Ox.print('NUMBER OF ITEMS:', data.items);
pandora.$ui.folderList[
pandora.getListData().folder
].value(list.id, 'items', data.items);
}
})
.reloadList();
});
}
}
});
return that;
};

View file

@ -17,7 +17,7 @@ pandora.ui.listDialog = function(list, section) {
} else if (id == 'icon') {
return pandora.ui.listIconPanel(list);
} else if (id == 'query') {
return pandora.$ui.filter = pandora.ui.filter();
return pandora.$ui.filter = pandora.ui.filter(list);
}
},
tabs: tabs