Added notification when appcache is updated

This commit is contained in:
Colin McLeod
2015-06-02 23:52:23 -07:00
parent 0ae4957976
commit f0f947cad4
3 changed files with 32 additions and 0 deletions

View File

@@ -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);
}
}]);