Skip to content

Commit 9425ab5

Browse files
vintaclaude
andcommitted
refactor(js): replace var with const for immutable bindings
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7b6829c commit 9425ab5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

website/static/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
1+
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
22

33
function getScrollBehavior() {
44
return reducedMotion.matches ? "auto" : "smooth";
@@ -105,7 +105,7 @@ rows.forEach(function (row, i) {
105105

106106
function collapseAll() {
107107
if (!tbody) return;
108-
var openRows = tbody.querySelectorAll("tr.row.open");
108+
const openRows = tbody.querySelectorAll("tr.row.open");
109109
openRows.forEach(function (row) {
110110
row.classList.remove("open");
111111
row.setAttribute("aria-expanded", "false");
@@ -122,7 +122,7 @@ function applyFilters() {
122122
let show = true;
123123

124124
if (activeFilter) {
125-
var rowTags = row.dataset.tags;
125+
const rowTags = row.dataset.tags;
126126
show = rowTags ? rowTags.split("||").includes(activeFilter) : false;
127127
}
128128

@@ -236,7 +236,7 @@ function sortRows() {
236236
applyFilters();
237237
}
238238

239-
var sortHeaders = document.querySelectorAll("th[data-sort]");
239+
const sortHeaders = document.querySelectorAll("th[data-sort]");
240240

241241
function updateSortIndicators() {
242242
sortHeaders.forEach(function (th) {

0 commit comments

Comments
 (0)