summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/HubView.js')
-rwxr-xr-xStoneIsland/www/js/lib/blogs/HubView.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index 38a7eecf..d2d26787 100755
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/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,14 @@ 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
+ setTimeout(HubLoader.load, count < 3 ? 1000 : 30000)
}
return HubLoader
})()