From 5dd9fde4f4ec341ded8931ab74452acabda40966 Mon Sep 17 00:00:00 2001 From: "Glitch (t404null-unstable)" Date: Wed, 2 Jul 2025 22:10:14 +0000 Subject: [PATCH] Smol loop reduction --- assets/js/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index e08d6ec..8f79514 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -130,15 +130,13 @@ function pg_ctrl() { let n = i; button.textContent = "•"; //• not · pgctrl.appendChild(button); - } - if (pgctrl) - [].slice.call(pgctrl.children).forEach((m, n) => - m.addEventListener("click", function () { + + if (pgctrl) button.addEventListener("click", function () { reset(); slider_index = n; set(); }) - ); + } } function set() {