1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-07-02 16:58:30 +00:00

Run JS earlier

This commit is contained in:
Unrud 2022-07-28 16:20:55 +02:00
parent 22d2d4af4c
commit 7d0ab1efc5
4 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
window.addEventListener("load", function() {
window.addEventListener("DOMContentLoaded", function() {
function resetSelect(select) {
for (let option of select.options) {
option.selected = option.defaultSelected;

View file

@ -1,4 +1,4 @@
window.addEventListener("load", function() {
window.addEventListener("DOMContentLoaded", function() {
document.querySelector("button[data-name=nav-open]").addEventListener("click", function() {
document.documentElement.classList.add("nav-opened");
});

View file

@ -1,4 +1,4 @@
window.addEventListener("load", function() {
window.addEventListener("DOMContentLoaded", function() {
for (let link of document.querySelectorAll("nav a")) {
link.addEventListener("click", function() {
let fragmentIndex = link.href.indexOf("#");

View file

@ -1,4 +1,4 @@
window.addEventListener("load", function() {
window.addEventListener("DOMContentLoaded", function() {
function findActiveSection(sections) {
let result = sections[0];
for (let [section, link] of sections) {