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) {
|
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() {
|
||||||
|
|
Loading…
Reference in a new issue