add news imte if list is empty

This commit is contained in:
j 2012-02-23 23:45:56 +05:30
parent c1738fc346
commit 0ee23670e7

View file

@ -18,9 +18,13 @@ pandora.ui.news = function(width, height) {
pandora.api.getNews({}, function(result) { pandora.api.getNews({}, function(result) {
items = result.data.items; items = result.data.items;
selected = items[0].id; if(items.length) {
renderItem(); selected = items[0].id;
renderList(); renderItem();
renderList();
} else if (isEditable) {
addItem();
}
}); });
function addItem() { function addItem() {