From 80d012f3adb0a02efbe78437fccc4f0ddcfecc4c Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 14 May 2014 18:25:50 +1000 Subject: [PATCH] Fixes: U4-4771 u7.1.1 Media section can't view images RangeError: Maximum call stack size exceeded --- .../src/common/services/util.service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js index 727319e93d..4b9fe44d0b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js @@ -139,7 +139,8 @@ function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, me return { height: minDisplayHeight, imgCount: 1 }; } else if (idealImages.length === idealImgPerRow && targetHeight < maxRowHeight) { - //if we're already dealing with the ideal images per row and it's not quite there, we can scale up a little bit so + + //if we're already dealing with the ideal images per row and it's not quite wide enough, we can scale up a little bit so // long as the targetHeight is currently less than the maxRowHeight. The scale up will be half-way between our current // target height and the maxRowHeight (we won't loop forever though - if there's a difference of 5 px we'll just quit) @@ -152,9 +153,8 @@ function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, me } } - //Ok, we couldn't actually scale it up with the ideal row count (TBH I'm not sure that this would ever happen but we'll take it into account) - // we'll just recurse with another image count. - return this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow + 1, margin); + //Ok, we couldn't actually scale it up with the ideal row count we'll just recurse with a lesser image count. + return this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow - 1, margin); } else { //we have additional images so we'll recurse and add 1 to the idealImgPerRow until it fits