Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix leaking variables to global scope #26

Merged
merged 1 commit into from

2 participants

@glensc

imgPreloader, preloadPrevImage and preloadNextImage leaked to global scope

@glensc glensc fix leaking variables to global scope
imgPreloader, preloadPrevImage and preloadNextImage leaked to global
scope
60b551f
@krewenki
Owner
@glensc

please merge (or cherry pick) fix from #5 as well

@krewenki krewenki was assigned
@krewenki krewenki merged commit f160ab3 into krewenki:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2012
  1. @glensc

    fix leaking variables to global scope

    glensc authored
    imgPreloader, preloadPrevImage and preloadNextImage leaked to global
    scope
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 jquery.lightbox.js
View
5 jquery.lightbox.js
@@ -195,7 +195,7 @@
};
function doChangeImage() {
- imgPreloader = new Image();
+ var imgPreloader = new Image();
// once image is preloaded, resize image container
imgPreloader.onload = function() {
@@ -246,6 +246,7 @@
};
function preloadNeighborImages() {
+ var preloadPrevImage, preloadNextImage;
if (opts.loopImages && opts.imageArray.length > 1) {
preloadNextImage = new Image();
preloadNextImage.src = opts.imageArray[(opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1][0];
@@ -494,4 +495,4 @@
jsonData: null,
jsonDataParser: null
};
-})(jQuery);
+})(jQuery);
Something went wrong with that request. Please try again.