Skip to content

Commit

Permalink
handle an empty feeds list
Browse files Browse the repository at this point in the history
  • Loading branch information
mboinet committed May 20, 2013
1 parent dd40e88 commit 19dd79b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/scripts/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,25 @@ define(['jquery', 'models', 'templates','conf','utils'],
// this is called each time the collection is
// synced
onSync: function(){
// in case there are no feeds after a refresh
if (this.collection.length == 0){

var msg = "No feeds";

if (models.settingsModel.get("hideEmptyCategories")){
msg = "No unread feeds";
}

// add the list element
this.$lv.html(tpl.roListElement({text: msg}));
this.LVrefreshNeeded = true;
}

if (this.LVrefreshNeeded){
this.$lv.listview("refresh");
this.LVrefreshNeeded = false;
}

},

initialize: function(){
Expand Down

0 comments on commit 19dd79b

Please sign in to comment.