From 84ddb071303c930e4d9907b013e8021b388bcb8b Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 12 Jun 2015 22:35:37 +0200 Subject: [PATCH] bugfixes small images displayed incorrectly in popup, and there we're navigation controls in popup sometimes when there were only one image --- js/qvitter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/qvitter.js b/js/qvitter.js index 8c872f9..0a8bd45 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -1470,7 +1470,7 @@ $('body').on('click','.stream-item .queet img.attachment-thumb',function (event) var footerHTML = $parentStreamItemClone.find('.queet').outerHTML(); $queetThumbsClone.find('img.attachment-thumb[src="' + thisAttachmentThumbSrc + '"]').parent().addClass('display-this-thumb'); - var imgNum = parentStreamItem.find('.attachment-thumb').length; + var imgNum = parentStreamItem.children('.queet').find('.attachment-thumb').length; if(imgNum > 1) { $queetThumbsClone.find('.queet-thumbs').before('
'); $queetThumbsClone.find('.queet-thumbs').after('
'); @@ -1516,7 +1516,7 @@ function calculatePopUpAndImageDimensions(img_src) { var displayImgWidth = thisImgWidth; var popUpWidth = 540; if(thisImgHeight > maxImageHeight) { - displayImgWidth = Math.round(thisImgHeight/maxImageHeight*displayImgWidth); + displayImgWidth = Math.round(maxImageHeight/thisImgHeight*displayImgWidth); } } else if(thisImgWidth < 900) {