mirror of
https://github.com/vinta/awesome-python.git
synced 2026-04-11 02:11:42 +08:00
refactor(js): replace var with const for immutable bindings
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7b6829c26e
commit
9425ab5921
@ -1,4 +1,4 @@
|
|||||||
var reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
|
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||||
|
|
||||||
function getScrollBehavior() {
|
function getScrollBehavior() {
|
||||||
return reducedMotion.matches ? "auto" : "smooth";
|
return reducedMotion.matches ? "auto" : "smooth";
|
||||||
@ -105,7 +105,7 @@ rows.forEach(function (row, i) {
|
|||||||
|
|
||||||
function collapseAll() {
|
function collapseAll() {
|
||||||
if (!tbody) return;
|
if (!tbody) return;
|
||||||
var openRows = tbody.querySelectorAll("tr.row.open");
|
const openRows = tbody.querySelectorAll("tr.row.open");
|
||||||
openRows.forEach(function (row) {
|
openRows.forEach(function (row) {
|
||||||
row.classList.remove("open");
|
row.classList.remove("open");
|
||||||
row.setAttribute("aria-expanded", "false");
|
row.setAttribute("aria-expanded", "false");
|
||||||
@ -122,7 +122,7 @@ function applyFilters() {
|
|||||||
let show = true;
|
let show = true;
|
||||||
|
|
||||||
if (activeFilter) {
|
if (activeFilter) {
|
||||||
var rowTags = row.dataset.tags;
|
const rowTags = row.dataset.tags;
|
||||||
show = rowTags ? rowTags.split("||").includes(activeFilter) : false;
|
show = rowTags ? rowTags.split("||").includes(activeFilter) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ function sortRows() {
|
|||||||
applyFilters();
|
applyFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
var sortHeaders = document.querySelectorAll("th[data-sort]");
|
const sortHeaders = document.querySelectorAll("th[data-sort]");
|
||||||
|
|
||||||
function updateSortIndicators() {
|
function updateSortIndicators() {
|
||||||
sortHeaders.forEach(function (th) {
|
sortHeaders.forEach(function (th) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user