Fix error when no masonry is found

alternate-navbar
Maik de Kruif 3 years ago
parent 81689b93f3
commit 1e754b8ca2
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 5
      themes/maik-blog/assets/js/list_columns.js

@ -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)

Loading…
Cancel
Save