From a1fbe0b115fd9f9b654dae79f266581c32ba00d2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jan 2016 23:51:37 +0100 Subject: backup db, handle being offline better --- StoneIsland/www/js/lib/blogs/HubView.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'StoneIsland/www/js/lib/blogs/HubView.js') diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index 687a3b95..9433b686 100755 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/www/js/lib/blogs/HubView.js @@ -21,11 +21,16 @@ var HubView = ScrollableView.extend({ this.deferScrollToTop() app.footer.hide() document.body.className = "hub" + if (! this.populated) { + this.populate( BACKUP_DB.hub ) + } }, galleries: {}, + populated: false, populate: function(data){ // sort posts by date, reversed + this.populated = true this.data = data.map(function(s){ return [ +moment(s.date), s ] }).sort(function(a,b){ -- cgit v1.2.3-70-g09d2