diff --git a/dist/main.js b/dist/main.js index dcd6c06..e58b91c 100644 Binary files a/dist/main.js and b/dist/main.js differ diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 5770b5c..7118c03 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -56,7 +56,7 @@ photo.load = function(photoID, albumID) { setTimeout(() => { lychee.content.show() - //photo.preloadNext(photoID, albumID); + photo.preloadNext(photoID); }, 300) }) @@ -66,21 +66,16 @@ photo.load = function(photoID, albumID) { // Preload the next photo for better response time photo.preloadNext = function(photoID) { - // Never preload on mobile devices with bare RAM and - // mostly mobile internet - // {{ code }} - if (album.json && - album.json.content && - album.json.content[photoID] && - album.json.content[photoID].nextPhoto!='') { + album.json.content && + album.json.content[photoID] && + album.json.content[photoID].nextPhoto!='') { let nextPhoto = album.json.content[photoID].nextPhoto, url = album.json.content[nextPhoto].url - photo.cache = new Image() - photo.cache.src = url - photo.cache.onload = () => photo.cache = null + $('head [data-prefetch]').remove() + $('head').append(``) }