From 0ee23670e79656f83ff0c558f01b47b74297f61b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 23 Feb 2012 23:45:56 +0530 Subject: [PATCH] add news imte if list is empty --- static/js/pandora/news.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/news.js b/static/js/pandora/news.js index 010dc264..74d54433 100644 --- a/static/js/pandora/news.js +++ b/static/js/pandora/news.js @@ -18,9 +18,13 @@ pandora.ui.news = function(width, height) { pandora.api.getNews({}, function(result) { items = result.data.items; - selected = items[0].id; - renderItem(); - renderList(); + if(items.length) { + selected = items[0].id; + renderItem(); + renderList(); + } else if (isEditable) { + addItem(); + } }); function addItem() {