Add catalog action bar with image size selector

This commit is contained in:
Dominic Ferrando
2025-04-20 23:48:51 -04:00
parent 2818c98e4e
commit ffafc896e2
4 changed files with 53 additions and 8 deletions
+17
View File
@@ -55,3 +55,20 @@ function highlightPost(postId, e, status = true) {
}
}
}
function resizeCatalogPreviewImgs() {
const value = $("selectSortBy").value;
const postsImages = Array.from(document.querySelectorAll(".catalog-preview img"));
for (const postImage of postsImages) {
switch (value) {
case "small":
postImage.classList.remove("catalog-preview-img-large")
postImage.classList.add("catalog-preview-img-small")
break;
case "large":
postImage.classList.remove("catalog-preview-img-small")
postImage.classList.add("catalog-preview-img-large")
break;
}
}
}