From 0d4f14734951bdb85cf3cda0948b0b8a203c5901 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 15 Jul 2021 17:16:33 -0400 Subject: [PATCH] pad_editbar: Simplify iteration --- src/static/js/pad_editbar.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 5732ca451..747b3bde1 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -216,9 +216,7 @@ const padeditbar = (() => { // hide all modules and remove highlighting of all buttons if (moduleName === 'none') { const returned = false; - for (let i = 0; i < this.dropdowns.length; i++) { - const thisModuleName = this.dropdowns[i]; - + for (const thisModuleName of this.dropdowns) { // skip the userlist if (thisModuleName === 'users') continue; @@ -237,8 +235,7 @@ const padeditbar = (() => { } else { // hide all modules that are not selected and remove highlighting // respectively add highlighting to the corresponding button - for (let i = 0; i < this.dropdowns.length; i++) { - const thisModuleName = this.dropdowns[i]; + for (const thisModuleName of this.dropdowns) { const module = $(`#${thisModuleName}`); if (module.hasClass('popup-show')) {