From 987d7db5e6b7dfd2930014873ed9cf67bfd269ff Mon Sep 17 00:00:00 2001 From: vigrond Date: Wed, 7 Mar 2012 15:09:03 -0800 Subject: [PATCH] Fixed endless recursion loop bug that caused browser to freeze when container is too 'high' because of lengthy pp_description. --- js/jquery.prettyPhoto.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/jquery.prettyPhoto.js b/js/jquery.prettyPhoto.js index 0f9ac8a..357b787 100644 --- a/js/jquery.prettyPhoto.js +++ b/js/jquery.prettyPhoto.js @@ -595,11 +595,13 @@ pp_containerHeight = imageHeight, pp_containerWidth = imageWidth; }; - _getDimensions(imageWidth,imageHeight); + if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; + + _getDimensions(imageWidth,imageHeight); }; return {