Skip to content

Commit

Permalink
Reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
brittnylapierre committed Dec 1, 2023
1 parent ae9b4ae commit f0895b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/javascript/controllers/iiif_viewer_component_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ export default class extends Controller {
initialize() {
let searchInput = document.getElementById("pvSearch");
let resetButton = document.getElementById("pvSearchReset");
window.onload = (event) => {
console.log("page is fully loaded");
var queryParams = new URLSearchParams(window.location.search);
if(queryParams.has("q") && queryParams.get("q") != "") resetButton.style.display ="inherit";
else resetButton.style.display ="none";
};
resetButton.addEventListener("click", ()=>{
searchInput.value = '';
// Construct URLSearchParams object instance from current URL querystring.
Expand Down Expand Up @@ -38,6 +32,12 @@ export default class extends Controller {
manifest,
canvasIndex
};

console.log("page is fully loaded");
var queryParams = new URLSearchParams(window.location.search);
if(queryParams.has("q") && queryParams.get("q") != "") resetButton.style.display ="inherit";
else resetButton.style.display ="none";

let viewer = UV.init("page-viewer", data);

viewer.on(
Expand Down

0 comments on commit f0895b4

Please sign in to comment.