Fix error when no masonry is found

This commit is contained in:
2021-09-24 09:49:00 +02:00
parent 81689b93f3
commit 1e754b8ca2
+4 -1
View File
@@ -7,9 +7,12 @@ function resizeItem(masonry, item){
function resizeAll(){
let masonry = document.getElementsByClassName("masonry")[0];
if (!masonry) return;
masonry.style.gridAutoRows = "20px"
masonry.style.marginBottom = "80px"
let allItems = document.getElementsByClassName("masonry-item");
let allItems = masonry.getElementsByClassName("masonry-item");
for (const item of allItems) {
resizeItem(masonry, item)