diff --git a/js/default.js b/js/default.js index 38386fc..52fc03e 100644 --- a/js/default.js +++ b/js/default.js @@ -218,6 +218,11 @@ _paq.push(['enableLinkTracking']); }); } + function appCacheUpdateReady () { + window.applicationCache.swapCache(); + // TODO: find what resource is loaded currently and reload it if it has changed + } + function init(router) { router.setCallback(loadPageContent); @@ -225,6 +230,11 @@ _paq.push(['enableLinkTracking']); router.runRouter(location.pathname); }); + window.addEventListener("updateready", appCacheUpdateReady); + if (window.applicationCache.status === window.applicationCache.UPDATEREADY) { + appCacheUpdateReady(); + } + $(document).ready(function () { $('#nav-menu a.menuitem').click(function () { $(this).closest('ul').find('li.active').removeClass('active');