From 37f18d7fa620283d36c28be7b5d214e274cea384 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 6 Nov 2017 00:58:43 +0100 Subject: build --- StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js') diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js index 38a7eecf..4164ab0e 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js @@ -22,6 +22,7 @@ var HubView = ScrollableView.extend({ this.deferScrollToTop() app.footer.hide() document.body.className = "hub" + HubLoader.isNeeded() if (! this.populated) { this.populate( BACKUP_DB.hub ) } @@ -143,12 +144,13 @@ var HubLoader = (function(){ var count = 0 var HubLoader = {} var loader + var needed = false HubLoader.init = function(v){ view = v } HubLoader.add = function(items){ queue = items - this.load() + HubLoader.load() } HubLoader.load = function(){ item = queue.shift() @@ -167,10 +169,15 @@ var HubLoader = (function(){ HubLoader.build() } } + HubLoader.isNeeded = function(){ + needed = true + } HubLoader.build = function(){ view.append(item) view.scroller.refresh() - setTimeout(HubLoader.load, count < 4 ? 50 : 5000) + if (count === 3 && ! needed) return + if (count === 10) return + setTimeout(HubLoader.load, count < 3 ? 1000 : 5000) } return HubLoader })() -- cgit v1.2.3-70-g09d2