Allow upgrades section to no longer collapse #767

This commit is contained in:
Daniël van Noord
2021-04-30 20:37:56 +02:00
parent 091b1f100e
commit 09b0ca83ae
6 changed files with 65 additions and 52 deletions

View File

@@ -0,0 +1,20 @@
import { CMOptions } from '../VariablesAndData';
/**
* This function toggles the upgrade to be always expanded
* It is called by a change in CM.Options.ToolWarnPos
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
*/
export default function ToggleUpgradeSectionsAlwaysExpanded() {
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
if (CMOptions.UpgradesNeverCollapse || section.id === 'products') {
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
} else if (section.id === 'vaultUpgrades') {
section.style.height = '30px'; // eslint-disable-line no-param-reassign
} else if (section.id === 'upgrades') {
section.style.height = '60px'; // eslint-disable-line no-param-reassign
} else {
section.style.height = '60px'; // eslint-disable-line no-param-reassign
}
});
}