summaryrefslogtreecommitdiffstats
path: root/theme/javascript/utils
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/utils')
-rw-r--r--theme/javascript/utils/appcache.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/theme/javascript/utils/appcache.js b/theme/javascript/utils/appcache.js
new file mode 100644
index 0000000..e813ab0
--- /dev/null
+++ b/theme/javascript/utils/appcache.js
@@ -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
+ };
+}); \ No newline at end of file