Browse Source

mirador fix

master
rdrew 1 week ago
parent
commit
6cd53d868d
  1. 29
      js/mirador-mods.js

29
js/mirador-mods.js

@ -1,7 +1,27 @@
//This code waits for the viewer to load with the search panel open, then it closes the search 'companion window'
//leaving the search icon visible. This combo is not available in the configs
window.addEventListener("load", () => {
const tryInit = (attempts = 0) => {
const searchPanel = document.querySelector("div.mirador31");
const searchPanelToggle = document.querySelector("button.mirador34");
if (!searchPanel || !searchPanelToggle) {
if (attempts < 20) setTimeout(() => tryInit(attempts + 1), 250);
return;
}
searchPanel.style.display = "none";
searchPanel.style.visibility = "hidden";
searchPanelToggle.setAttribute("aria-expanded", "false");
searchPanelToggle.setAttribute("aria-label", "Expand sidebar");
searchPanelToggle.setAttribute("title", "Expand sidebar");
searchPanelToggle.click();
};
tryInit();
});
/* /*
This code waits for the viewer to load with the search panel open, then it closes the search 'companion window'
leaving the search icon visible. This combo is not available in the configs
*/
window.addEventListener("load", (event) => { window.addEventListener("load", (event) => {
// find elements // find elements
const searchPanel = document.querySelector("div.mirador31"); const searchPanel = document.querySelector("div.mirador31");
@ -21,5 +41,6 @@ window.addEventListener("load", (event) => {
// //
//fake click //fake click
searchPanelToggle.click(); searchPanelToggle.click();
}); });
*/

Loading…
Cancel
Save