Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
noriyotcp committed Sep 28, 2024
1 parent 8afce51 commit 65be70f
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions assets/js/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,34 +89,18 @@ document.addEventListener("DOMContentLoaded", function () {
}

// setup
const entriesList = document.querySelector(".entries-list");
const entriesLists = document.querySelectorAll(".entries-list");
// If the entries list is not found, do nothing
if (!entriesList) {
return false;
}
if (entriesLists.length === 0) {
return false;
}

// const listItems = entriesList.querySelectorAll(".list__item");

const listItems = [];
const listItemLinks = [];
entriesLists.forEach((list) => {
list.querySelectorAll(".list__item").forEach((item) => {
listItems.push(item);
}
);
});

// const listItemLinks = entriesList.querySelectorAll(".list__item h2 > a");

const listItemLinks = [];
entriesLists.forEach((list) => {
list.querySelectorAll(".list__item h2 > a").forEach((item) => {
listItemLinks.push(item);
});
list.querySelectorAll(".list__item h2 > a").forEach((item) => {
listItemLinks.push(item);
});
});

console.log(listItemLinks);

Expand All @@ -135,11 +119,6 @@ document.addEventListener("DOMContentLoaded", function () {
return false;
}

// remove .item-focus class from all list items
listItems.forEach((linkItem) => {
linkItem.classList.remove("item-focus");
});

listItemLinks[focusedItemIndex].focus();
console.log(focusedItemIndex);

Expand Down

0 comments on commit 65be70f

Please sign in to comment.