diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-12-11 04:35:49 -0600 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-12-11 04:35:49 -0600 |
| commit | 4c2fec26f750e923577217c1b92daa08ec8a458a (patch) | |
| tree | 7b7fe697e547a4c96005b64ee859a8668d0fdacb /StoneIsland/platforms/ios/www/js/index.js | |
| parent | 190e24251c17733eff8fc1b11a077ca2da4b6c4f (diff) | |
improve loading and stuff. ios build 0.3.3
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/index.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/index.js | 18 |
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 })() |
