Add updateready event callback
This commit is contained in:
parent
b7b63b843c
commit
ac0571392b
@ -1 +1 @@
|
|||||||
CACHE MANIFEST
# v36
CACHE:
index.html
css/bootstrap.css
css/jgrowl.css
css/main.css
js/main-min.js
js/require.js
NETWORK:
*
|
CACHE MANIFEST
# v37
CACHE:
index.html
css/bootstrap.css
css/jgrowl.css
css/main.css
js/main-min.js
js/require.js
NETWORK:
*
|
||||||
|
14
js/main.js
14
js/main.js
@ -15,12 +15,14 @@ require(["jquery", "core"], function($, core) {
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
// If browser has detected a new application cache.
|
// If browser has detected a new application cache.
|
||||||
if (window.applicationCache
|
if (window.applicationCache) {
|
||||||
&& window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
window.applicationCache.addEventListener('updateready', function(e) {
|
||||||
window.applicationCache.swapCache();
|
if(window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
||||||
window.location.reload();
|
window.applicationCache.swapCache();
|
||||||
return;
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
|
||||||
core.init();
|
core.init();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user