forked from jakubkowalczyk-pl/jgallery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes jakubkowalczyk-pl#18: Preload images.
Preloads the next and previous image when a user navigates to an image. Preloading happens right after the navigation is done. Calling load on an already loaded image will not cause the browser to do another request, this way the method can be called multiple times without worry. Uses Promise.all to make sure both images get loaded as fast as possible.
- Loading branch information
Showing
1 changed file
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters