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

Function showViewOptionsPopover

public/js/fileListView.js:5985–6025  ·  view source on GitHub ↗
(triggerBtn)

Source from the content-addressed store, hash-verified

5983}
5984
5985function showViewOptionsPopover(triggerBtn) {
5986 const pop = ensureViewOptionsPopover();
5987 if (pop.style.display === "block" && viewOptionsAnchor === triggerBtn) {
5988 hideViewOptionsPopover();
5989 return;
5990 }
5991
5992 pop.innerHTML = "";
5993 viewOptionsAnchor = triggerBtn || null;
5994
5995 const title = document.createElement("div");
5996 title.className = "vo-title";
5997 title.textContent = t("view_options") || "View options";
5998 pop.appendChild(title);
5999
6000 if (window.viewMode === "gallery") {
6001 buildGalleryControls(pop);
6002 } else {
6003 buildRowHeightControls(pop);
6004 }
6005
6006 // separator then zoom controls
6007 const sep = document.createElement("div");
6008 sep.className = "vo-separator";
6009 pop.appendChild(sep);
6010 buildZoomControls(pop);
6011
6012 const sep2 = document.createElement("div");
6013 sep2.className = "vo-separator";
6014 pop.appendChild(sep2);
6015 buildDualPaneToggle(pop);
6016
6017 positionPopover(pop, triggerBtn);
6018 pop.style.display = "block";
6019
6020 if (!viewOptionsBound) {
6021 document.addEventListener("click", viewOptionsOutside, true);
6022 document.addEventListener("keydown", viewOptionsEscape, true);
6023 viewOptionsBound = true;
6024 }
6025}
6026
6027function bindViewOptionsButton() {
6028 const btn = document.getElementById("viewOptionsBtn");

Callers 1

bindViewOptionsButtonFunction · 0.85

Calls 8

ensureViewOptionsPopoverFunction · 0.85
hideViewOptionsPopoverFunction · 0.85
tFunction · 0.85
buildGalleryControlsFunction · 0.85
buildRowHeightControlsFunction · 0.85
buildZoomControlsFunction · 0.85
buildDualPaneToggleFunction · 0.85
positionPopoverFunction · 0.85

Tested by

no test coverage detected