(triggerBtn)
| 5983 | } |
| 5984 | |
| 5985 | function 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 | |
| 6027 | function bindViewOptionsButton() { |
| 6028 | const btn = document.getElementById("viewOptionsBtn"); |
no test coverage detected