MCPcopy Create free account
hub / github.com/error311/FileRise / applyGalleryColumns

Function applyGalleryColumns

public/js/fileListView.js:5709–5725  ·  view source on GitHub ↗
(cols)

Source from the content-addressed store, hash-verified

5707}
5708
5709function 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
5727let viewOptionsPopover = null;
5728let viewOptionsAnchor = null;

Callers 2

fileListView.jsFile · 0.85
buildGalleryControlsFunction · 0.85

Calls 2

clampGalleryColumnsFunction · 0.85
getMaxImageHeightFunction · 0.85

Tested by

no test coverage detected