From acfac8b86c312ffdbd03f9e56aaa45df629d9771 Mon Sep 17 00:00:00 2001 From: rdrew Date: Wed, 27 Nov 2024 15:23:48 -0400 Subject: [PATCH] mirador mods --- js/mirador-mods.js | 24 ++++++++++++++++++++++-- olives.theme | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/js/mirador-mods.js b/js/mirador-mods.js index fa89f3d..e4ca649 100755 --- a/js/mirador-mods.js +++ b/js/mirador-mods.js @@ -1,7 +1,6 @@ /* 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 -*/ jQuery(window).on("load", function() { jQuery(".mirador31").css({ "display": "none", @@ -19,4 +18,25 @@ jQuery(window).on("load", function() { }); jQuery(".mirador34").click(); console.log("window loaded, mirador-mods applied"); -}); \ No newline at end of file +}); + +*/ +window.addEventListener("load", (event) => { + const searchPanel = document.querySelector(".mirador31"); + const searchPanelToggle = document.querySelector("button.mirador34"); + const searchPanelIcon = document.querySelector("button.MuiButtonBase-root.MuiTab-root.mirador26 svg"); + console.log(searchPanel); + searchPanel.style.display = "none"; + searchPanel.style.transform = "translateX(0px)"; + searchPanel.style.visibility = "hidden"; + + searchPanelToggle.setAttribute("aria-expanded", "false"); + searchPanelToggle.setAttribute("aria-label", "Expand sidebar"); + searchPanelToggle.setAttribute("title", "Expand sidebar"); + + searchPanelToggle.click(); + + console.log("page is fully loaded"); + console.log(searchPanel); + +}); diff --git a/olives.theme b/olives.theme index 651e5ed..278a8cc 100755 --- a/olives.theme +++ b/olives.theme @@ -698,10 +698,10 @@ function _olives_hex_to_hsl(string $hex_string) { return [$h, $s, $l]; } - function olives_preprocess_mirador(&$variables) { -/* + $variables['window_config']['allowClose'] = TRUE; $variables['thumbnail_navigation_position'] = 'far-right'; +/* $variables['window_config']['panels']['info'] = FALSE; $variables['window_config']['panels']['attribution'] = FALSE; $variables['window_config']['panels']['canvas'] = FALSE;