diff --git a/app/js/app.js b/app/js/app.js index 0e01c922..006880a1 100755 --- a/app/js/app.js +++ b/app/js/app.js @@ -47,4 +47,15 @@ angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'ui.sortable', $rootScope.$broadcast('close', e); }; + if ($window.applicationCache) { + // Listen for appcache updated event, present refresh to update view + $window.applicationCache.addEventListener('updateready', function(e) { + if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { + // Browser downloaded a new app cache. + $rootScope.appCacheUpdate = true; + $rootScope.$apply(); + } + }, false); + } + }]); diff --git a/app/less/header.less b/app/less/header.less index 1a17fae8..7e21127a 100755 --- a/app/less/header.less +++ b/app/less/header.less @@ -1,3 +1,20 @@ +#app-update { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 3em; + z-index: 3; + line-height: 3em; + text-align: center; + background-color: @bg; + + a, a:visited { + text-decoration: none; + color: @warning; + } +} + header { background-color: @bg; margin: 0; diff --git a/app/views/_header.html b/app/views/_header.html index 5b2f3b3c..d3598777 100755 --- a/app/views/_header.html +++ b/app/views/_header.html @@ -1,3 +1,7 @@ +
+