summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/index.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/index.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js
index 0b3531dd..77f8a782 100755
--- a/StoneIsland/platforms/ios/www/js/index.js
+++ b/StoneIsland/platforms/ios/www/js/index.js
@@ -64,6 +64,8 @@ var app = (function(){
app.ready = function(){
if (window.cordova) {
+ document.addEventListener('pause', app.paused, false)
+ document.addEventListener('resume', app.resumed, false)
cordova.plugins.Keyboard.disableScroll(true)
geo.fetch()
}
@@ -74,12 +76,26 @@ var app = (function(){
// app.router.launch()
// }
// else {
- app.account.connect( app.router.launch.bind(app.router) )
+ push.init()
+ app.account.connect( app.router.launch.bind(app.router) )
// }
$("body").removeClass("loading")
}
+
+ var pause_time = 0
+ app.paused = function(){
+
+ }
+
+ app.resumed = function(){
+ if (! pause_time) return
+ if (Date.now() - pause_time > 60 * 60 * 1000) {
+ app.blog.refresh()
+ }
+ }
+
return app
})()