mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Added notification when appcache is updated
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<div id="app-update" ng-show="appCacheUpdate">
|
||||
<a href="#" onclick="window.location.reload()">Update Available! Click to Refresh</a>
|
||||
</div>
|
||||
|
||||
<header>
|
||||
<a class="l" ui-sref="shipyard" style="margin-right: 1em;" title="Ships"><svg class="icon xl"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#coriolis"></use></svg></a>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user