From d23cdae9c0cf6f7cc3c03c8e54482c16b062f7d0 Mon Sep 17 00:00:00 2001 From: rdrew Date: Wed, 27 Nov 2024 15:45:27 -0400 Subject: [PATCH] mirador mods --- js/mirador-mods.js | 27 +++++---------------------- olives.libraries.yml | 5 +---- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/js/mirador-mods.js b/js/mirador-mods.js index e4ca649..00f4964 100755 --- a/js/mirador-mods.js +++ b/js/mirador-mods.js @@ -1,31 +1,13 @@ /* 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", - "transform": "translateX(0px)", - "visibility": "hidden" - }); - jQuery("button.mirador34").attr({ - "aria-expanded": "false", - "aria-label": "Expand sidebar", - "title": "Expand sidebar" - }); - jQuery("button.MuiButtonBase-root.MuiTab-root.mirador26 svg").css({ - "font-size": "2.7em", - "margin-top": "21px" - }); - jQuery(".mirador34").click(); - console.log("window loaded, mirador-mods applied"); -}); - */ window.addEventListener("load", (event) => { + // find elements 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); + // hide the panel searchPanel.style.display = "none"; searchPanel.style.transform = "translateX(0px)"; searchPanel.style.visibility = "hidden"; @@ -34,9 +16,10 @@ window.addEventListener("load", (event) => { searchPanelToggle.setAttribute("aria-label", "Expand sidebar"); searchPanelToggle.setAttribute("title", "Expand sidebar"); + searchPanelIcon.style.fontSize = "2.7em"; + searchPanelIcon.style.marginTop = "21px"; + //fake click searchPanelToggle.click(); - console.log("page is fully loaded"); - console.log(searchPanel); }); diff --git a/olives.libraries.yml b/olives.libraries.yml index d51f120..4c04e7c 100755 --- a/olives.libraries.yml +++ b/olives.libraries.yml @@ -78,10 +78,7 @@ mirador-mods: version: VERSION js: js/mirador-mods.js: {} - dependencies: - - core/drupal - - core/once - + color-picker: version: VERSION css: