Disable gallery preloading unless moving forward by one.

Otherwise it can cause more performance problems than it fixes.
This commit is contained in:
ccd0 2015-10-17 22:34:30 -07:00
parent 9a60537365
commit f48b79c2cf

View File

@ -187,7 +187,8 @@ Gallery =
Header.scrollTo post.nodes.root
# Preload next image
Gallery.cache = Gallery.load Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError
if isNaN(oldID) or newID is (oldID + 1) % Gallery.images.length
Gallery.cache = Gallery.load Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError
error: ->
if @error?.code is MediaError.MEDIA_ERR_DECODE