forked from 0x2620/pandora
add news imte if list is empty
This commit is contained in:
parent
c1738fc346
commit
0ee23670e7
1 changed files with 7 additions and 3 deletions
|
@ -18,9 +18,13 @@ pandora.ui.news = function(width, height) {
|
|||
|
||||
pandora.api.getNews({}, function(result) {
|
||||
items = result.data.items;
|
||||
if(items.length) {
|
||||
selected = items[0].id;
|
||||
renderItem();
|
||||
renderList();
|
||||
} else if (isEditable) {
|
||||
addItem();
|
||||
}
|
||||
});
|
||||
|
||||
function addItem() {
|
||||
|
|
Loading…
Reference in a new issue