pad_editbar: Simplify iteration

This commit is contained in:
Richard Hansen 2021-07-15 17:16:33 -04:00
parent 11faf6104a
commit 0d4f147349

View file

@ -216,9 +216,7 @@ const padeditbar = (() => {
// hide all modules and remove highlighting of all buttons // hide all modules and remove highlighting of all buttons
if (moduleName === 'none') { if (moduleName === 'none') {
const returned = false; const returned = false;
for (let i = 0; i < this.dropdowns.length; i++) { for (const thisModuleName of this.dropdowns) {
const thisModuleName = this.dropdowns[i];
// skip the userlist // skip the userlist
if (thisModuleName === 'users') continue; if (thisModuleName === 'users') continue;
@ -237,8 +235,7 @@ const padeditbar = (() => {
} else { } else {
// hide all modules that are not selected and remove highlighting // hide all modules that are not selected and remove highlighting
// respectively add highlighting to the corresponding button // respectively add highlighting to the corresponding button
for (let i = 0; i < this.dropdowns.length; i++) { for (const thisModuleName of this.dropdowns) {
const thisModuleName = this.dropdowns[i];
const module = $(`#${thisModuleName}`); const module = $(`#${thisModuleName}`);
if (module.hasClass('popup-show')) { if (module.hasClass('popup-show')) {