From 3ddba04ceea45bc32df1d462818cd579c5009989 Mon Sep 17 00:00:00 2001 From: almic Date: Fri, 12 Apr 2024 08:00:44 -0600 Subject: [PATCH] Fix some bugs - Use `continue` in for loop instead of `return` - Fix double named variable/ function in `toggleText()` --- docs/js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/js/main.js b/docs/js/main.js index 5b113e1..999eb03 100644 --- a/docs/js/main.js +++ b/docs/js/main.js @@ -9,7 +9,7 @@ document.addEventListener( const clickFunc = button.onclick; if (!clickFunc) { button.onclick = () => console.log(buttonName + '; no click function'); - return; + continue; } let clickFuncBody = clickFunc.toString() ?? ''; if (clickFuncBody) { @@ -39,8 +39,8 @@ async function loadSourceCode(name, path) { * Toggles collapsed state on the named elements, and toggles the text on the * given element */ -function collapse(self, toggleText, name) { - toggleText(self, toggleText); +function collapse(self, text, name) { + toggleText(self, text); self.classList.toggle('collapse-active'); const elements = document.getElementsByName(name); if (!elements.length) {