Update page when new version of application cache

This commit is contained in:
Samy Pessé
2014-04-27 17:57:34 +02:00
parent 99ce48b146
commit 9fdc5da22d
3 changed files with 21 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
define([], function() {
var isAvailable = (typeof applicationCache !== "undefined");
var init = function() {
if (!isAvailable) return;
window.applicationCache.addEventListener('updateready', function() {
window.location.reload();
}, false);
};
return {
init: init
};
});