| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -262,12 +262,7 @@ define(["bean", | |||
| 262 | 262 | ||
| 263 | 263 | bonzo(galleryNode).removeClass('gallery--grid-mode').addClass('gallery--fullimage-mode'); | |
| 264 | 264 | ||
| 265 | - Array.prototype.forEach.call(overlay.bodyNode.querySelectorAll('.gallery__img'), function(el, i) { | ||
| 266 | - // Switch the current and next image to high quality src | ||
| 267 | - if (i === (currentImage - 1) || i === (currentImage)) { | ||
| 268 | - el.src = el.getAttribute('data-fullsrc'); | ||
| 269 | - } | ||
| 270 | - }); | ||
| 265 | + self.preloadImages(); | ||
| 271 | 266 | ||
| 272 | 267 | // Update CTAs | |
| 273 | 268 | self.gridModeCta.style.display = 'block'; | |
@@ -278,6 +273,15 @@ define(["bean", | |||
| 278 | 273 | if (e) { e.preventDefault(); } | |
| 279 | 274 | }; | |
| 280 | 275 | ||
| 276 | + this.preloadImages = function() { | ||
| 277 | + Array.prototype.forEach.call($images, function(el, i) { | ||
| 278 | + // Switch the current and next image to high quality src | ||
| 279 | + if (i === (currentImage - 1) || i === (currentImage)) { | ||
| 280 | + el.src = el.getAttribute('data-fullsrc'); | ||
| 281 | + } | ||
| 282 | + }); | ||
| 283 | + }; | ||
| 284 | + | ||
| 281 | 285 | this.toggleFurniture = function() { | |
| 282 | 286 | bonzo(galleryNode).toggleClass('gallery--hide-furniture'); | |
| 283 | 287 | }; | |
@@ -321,6 +325,8 @@ define(["bean", | |||
| 321 | 325 | ||
| 322 | 326 | currentImage = index + 1; | |
| 323 | 327 | self.imageIndexNode.innerHTML = currentImage; | |
| 328 | + | ||
| 329 | + self.preloadImages(); | ||
| 324 | 330 | } | |
| 325 | 331 | }); | |
| 326 | 332 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments