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

Function buildDualPaneToggle

public/js/fileListView.js:5924–5964  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

5922}
5923
5924function buildDualPaneToggle(host) {
5925 const wrap = document.createElement("div");
5926 wrap.className = "vo-control";
5927
5928 const row = document.createElement("label");
5929 row.className = "vo-toggle-row";
5930
5931 const text = document.createElement("span");
5932 text.className = "vo-toggle-text";
5933 text.textContent = t("dual_pane_mode") || "Dual-pane mode";
5934
5935 const toggle = document.createElement("input");
5936 toggle.type = "checkbox";
5937 toggle.className = "vo-toggle-input";
5938 toggle.id = "voDualPaneToggle";
5939 toggle.checked = localStorage.getItem("dualPaneMode") === "true";
5940 toggle.setAttribute("aria-label", text.textContent);
5941
5942 const applyDualPane = (enabled) => {
5943 localStorage.setItem("dualPaneMode", enabled ? "true" : "false");
5944 window.dualPaneEnabled = enabled;
5945 if (typeof window.applyDualPaneMode === "function") {
5946 window.applyDualPaneMode(enabled);
5947 } else {
5948 window.__frDualPanePending = enabled;
5949 }
5950 const panelToggle = document.getElementById("dualPaneMode");
5951 if (panelToggle) {
5952 panelToggle.checked = enabled;
5953 }
5954 };
5955
5956 toggle.addEventListener("change", () => {
5957 applyDualPane(toggle.checked);
5958 });
5959
5960 row.appendChild(text);
5961 row.appendChild(toggle);
5962 wrap.appendChild(row);
5963 host.appendChild(wrap);
5964}
5965
5966function positionPopover(pop, anchor) {
5967 if (!anchor) return;

Callers 1

showViewOptionsPopoverFunction · 0.85

Calls 2

tFunction · 0.85
applyDualPaneFunction · 0.85

Tested by

no test coverage detected