Permalink
Browse files

Merge pull request #225 from cjlarose/master

Preload images in inline gallery.
  • Loading branch information...
honestbleeps committed Feb 3, 2013
2 parents fb8781f + 85954ce commit f4b8b283f1ece8a14b3356638e06e31ad449c295
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/reddit_enhancement_suite.user.js
@@ -9263,10 +9263,18 @@ modules['showImages'] = {
this.trackImageLoad(imageLink, image);
this.makeImageZoomable(image);
},
preloadImages: function(srcs) {
for (var i = 0; i < srcs.length; i++) {
var img = new Image();
img.src = srcs[i].src;
}
},
generateGalleryExpando: function(expandoButton) {
var imageLink = expandoButton.imageLink;
var which = imageLink.galleryStart || 0;
this.preloadImages(imageLink.src);
var imgDiv = document.createElement('div');
addClass(imgDiv, 'madeVisible');
imgDiv.sources = imageLink.src;

0 comments on commit f4b8b28

Please sign in to comment.