diff --git a/media/com_joomgallery/js/imgjust/imgjust.js b/media/com_joomgallery/js/imgjust/imgjust.js index b1b40201b..afe3f23ab 100644 --- a/media/com_joomgallery/js/imgjust/imgjust.js +++ b/media/com_joomgallery/js/imgjust/imgjust.js @@ -107,10 +107,12 @@ class ImgJust { imgs[range.end].style.width = containerWidth - newRowWidth + "px"; imgs[range.end].style.height = newHeight + "px"; imgs[range.end].style.marginRight = "0"; + imgs[range.end].classList.add("end"); } const lastRange = rowRanges[rowRanges.length - 1]; for (var i = lastRange.start; i <= lastRange.end; i++) - imgs[i].style.marginBottom = "0"; + imgs[i].style.marginBottom = "0", + imgs[i].classList.add("last"); // All done. Now make visible. for (const img of imgs) diff --git a/media/com_joomgallery/js/imgjust/imgjust.min.js b/media/com_joomgallery/js/imgjust/imgjust.min.js index c9db0972d..e8a637be1 100644 --- a/media/com_joomgallery/js/imgjust/imgjust.min.js +++ b/media/com_joomgallery/js/imgjust/imgjust.min.js @@ -1 +1 @@ -class ImgJust{idealHeight=150;rowGap=0;columnGap=0;paddingLeft=0;paddingRight=0;paddingTop=0;paddingBottom=0;reload(){let t=this.container;getComputedStyle(t);let e=this.imgs,i=t.getBoundingClientRect().width-this.paddingLeft-this.paddingRight;if(i<=0)throw"ImgJust Error: No room for images. Client width is too small.";let s=[];for(var n=0;n=p;c--){h+=s[c]+this.columnGap;let y=h-i,$=y*y+r[p-1].get(c-1);$=0;p--){let G=_-1,R=o[p].get(G);x.unshift({start:R,end:G}),_=R}for(var B of x){for(var I=0,n=B.start;n<=B.end;n++)I+=s[n],e[n].style.marginBottom=this.rowGap+"px";let H=i-(B.end-B.start)*this.columnGap,J=Math.round(this.idealHeight*H/I);for(var L=0,n=B.start;nthis.reload())}} \ No newline at end of file +class ImgJust{idealHeight=150;rowGap=0;columnGap=0;paddingLeft=0;paddingRight=0;paddingTop=0;paddingBottom=0;reload(){let t=this.container;getComputedStyle(t);let e=this.imgs,i=t.getBoundingClientRect().width-this.paddingLeft-this.paddingRight;if(i<=0)throw"ImgJust Error: No room for images. Client width is too small.";let s=[];for(var n=0;n=p;c--){d+=s[c]+this.columnGap;let y=d-i,$=y*y+a[p-1].get(c-1);$=0;p--){let G=_-1,R=r[p].get(G);x.unshift({start:R,end:G}),_=R}for(var B of x){for(var I=0,n=B.start;n<=B.end;n++)I+=s[n],e[n].style.marginBottom=this.rowGap+"px";let L=i-(B.end-B.start)*this.columnGap,H=Math.round(this.idealHeight*L/I);for(var J=0,n=B.start;nthis.reload())}} \ No newline at end of file