From a485826e7c567c57579e991cd22ea8b20b803ed5 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Fri, 23 Jan 2026 19:39:49 +0100 Subject: [PATCH] use addEventListener for window load instead of onLoad avoids conflicts between different files --- res/static/song.js | 4 ++-- res/templates/preparar-misa.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/res/static/song.js b/res/static/song.js index 164507a..4f607f9 100644 --- a/res/static/song.js +++ b/res/static/song.js @@ -84,11 +84,11 @@ function getTranspose(song) { =========================================== */ // Init -window.onload = function () { +window.addEventListener("load", function () { var show = localStorage.getItem("show_chords") != "false"; showChords(show); document.getElementById("showChords").checked = show; -}; +}); function showChords(show) { if (show || show == "true") { diff --git a/res/templates/preparar-misa.html b/res/templates/preparar-misa.html index 11088f0..e65a2ce 100644 --- a/res/templates/preparar-misa.html +++ b/res/templates/preparar-misa.html @@ -237,7 +237,7 @@ function shareList(event) { } } -window.onload = function () { +window.addEventListener("load", function () { for (let e of document.getElementsByClassName("init")) { e.dispatchEvent(new Event("change")); } @@ -256,7 +256,7 @@ window.onload = function () { showChords.checked = false; showChords.dispatchEvent(new Event("change")); } -}; +}); {% include "footer.html" %}