(cols)
| 5707 | } |
| 5708 | |
| 5709 | function applyGalleryColumns(cols) { |
| 5710 | const clamped = clampGalleryColumns(cols); |
| 5711 | window.galleryColumns = clamped; |
| 5712 | localStorage.setItem("galleryColumns", clamped); |
| 5713 | |
| 5714 | const grid = document.querySelector(".gallery-container"); |
| 5715 | if (grid) { |
| 5716 | grid.style.gridTemplateColumns = `repeat(${clamped},minmax(0,1fr))`; |
| 5717 | } |
| 5718 | document.querySelectorAll(".gallery-thumbnail") |
| 5719 | .forEach(img => img.style.maxHeight = getMaxImageHeight() + "px"); |
| 5720 | |
| 5721 | const val = document.getElementById("galleryColumnsValue"); |
| 5722 | if (val) val.textContent = clamped; |
| 5723 | |
| 5724 | return clamped; |
| 5725 | } |
| 5726 | |
| 5727 | let viewOptionsPopover = null; |
| 5728 | let viewOptionsAnchor = null; |
no test coverage detected