mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 16:15:22 +00:00
Update page when new version of application cache
This commit is contained in:
@@ -2,6 +2,7 @@ define([
|
||||
"jQuery",
|
||||
"utils/storage",
|
||||
"utils/sharing",
|
||||
"utils/appcache",
|
||||
|
||||
"core/events",
|
||||
"core/font-settings",
|
||||
@@ -11,7 +12,7 @@ define([
|
||||
"core/progress",
|
||||
"core/sidebar",
|
||||
"core/search"
|
||||
], function($, storage, sharing, events, fontSettings, state, keyboard, navigation, progress, sidebar, search){
|
||||
], function($, storage, appCache, sharing, events, fontSettings, state, keyboard, navigation, progress, sidebar, search){
|
||||
var start = function(config) {
|
||||
var $book;
|
||||
$book = state.$book;
|
||||
@@ -30,6 +31,9 @@ define([
|
||||
// Init keyboard
|
||||
keyboard.init();
|
||||
|
||||
// Init appcache
|
||||
appCache.init();
|
||||
|
||||
// Bind sharing button
|
||||
sharing.init();
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user